There is a container control, TScrollBox, which contains several control elements.
Each control, being composite, contains (parents and owns) a delete button. Pressing the button initiates the deletion of the control item.
Removal involves the release of a component, and therefore the actual operation must be external to the element. The question is, what would be the best way to do this?
I really know a few options:
- a timer with a short interval (which starts with a button press);
- hidden external button (on which mouse messages and up messages are displayed);
- handler of the form handler.
Although I could confidently implement any of these methods, as I flatter myself, I am not sure which one will be better. In addition, the timer option seems childish, the hidden button is one hacker button, and the user message went too far. In short, all three seem equally half acceptable, more or less.
I can just be biased and not mind being convinced of the opposite. However, first of all, I would like to know what is the usual method for use in such cases (maybe something I was missing all the time).
source share