Janex72 1 Posted August 31 Hi All Experts! I need to create Button in runtime and assign OnClick Event. Create is easy and assign event to: MyNewButton.OnClick := MyOnClickEventProcedure; For this I need to previously write procedure MyOnClickEventProcedure in code in designtime. Is there some way to not permanently write MyOnClickEventProcedure in code, for example: MyNewButton.OnClick := MyUniversalProcedureForAllEvents; I don't yet know what events will be used during development. Is this possible? WBR Janex Share this post Link to post
dummzeuch 1517 Posted August 31 Your event handler must match the signature of the event to which you want to assign it. Many events are of the type TNotifyEvent, so this is the most versatile event signature. But I'm not sure I understand what exactly you want to achieve. Maybe a universal message handler would be a better fit for your purpose? But such a handler can not just be assigned. Share this post Link to post