Lazarus

Using the Lazarus IDE => General => Topic started by: oopman on May 26, 2022, 02:55:50 pm

Title: Copying a textbox also copies its event handling
Post by: oopman 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?
Title: Re: Copying a textbox also copies its event handling
Post by: dseligo 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