Recent

Author Topic: Copying a textbox also copies its event handling  (Read 210 times)

oopman

  • New Member
  • *
  • Posts: 11
Copying a textbox also copies its event handling
« on: May 26, 2022, 02:55:50 pm »
I just realized that now if you copy a textbox that has an event such as OnExit and paste the textbox the associated events are still linked to the original textbox in the new copied textbox?

I've often copied sets of components such as a label and textbox after I have them properly formatted. Then paste them on the form and rename them. This always worked in the past but at least with the latest version any events attached to the original text box are copied also? Is there a way to turn this off?

dseligo

  • Hero Member
  • *****
  • Posts: 611
Re: Copying a textbox also copies its event handling
« Reply #1 on: May 27, 2022, 01:57:46 am »
I don't know if there is a way to turn this off, but, as I remember, events were always copied along with components.
They are not copied to another form if method name doesn't exists there. So, as a workaround, you could copy your components to some empty form, they will 'lose' events references, and then you can copy them back to your original form.

 

TinyPortal © 2005-2018