I can see that several people have been looking for something like this on the internet and no tool gives such a possibility.
The point is that with a component selected, e.g. TButton, I would like to have in the clipboard both the component itself and all onClick events and their code. Then I would like to be able to paste them into another form. Of course, the pasted code would not work 100%. But it's about facilitating UI redevelopment.
This would facilitate the reconstruction of UI.
I think this would require a custom clipboard format that contains separate sections for
On the paste side, this format must be split and the component definition inserted into the form the event handlers into the source code. This might be quite difficult.
Implemented in revisions #5921 and #5925 as two new experts in the Form Designer category, also in the context menu of the form designer:
After a plain IDE Copy, Paste with Event Handlers still links the events, creating empty handlers where the form has none.
The Clipboard History now keeps the event handler code that Copy with Event Handlers puts on the clipboard (revision #5931). An entry shows the number of event handlers in a column of its own and their code below the text in the preview, and copying the entry back puts the code on the clipboard again, so Paste with Event Handlers also works with an entry from the history.