At runtime i create a TPanel which contains a TscrollBox and a TButton to close the TPanel itself.
Now, i get an abstract error when i close the TPanel within the TButton click event handler and i sort of understand it, because you can' t remove a button(whose owner is the TPanel) within its click event. A solution would be to make the TPanel a global variable or a field member of its parent and then create a timer in the click event which would remove it without errors. Is there another solution?