You can do the assignment whosrdaddy suggested with any procedure as long as that procedure has a parameter list that the event is expecting. For example, an OnClick event expects a single Sender parameter of type TObject. So providing the declaration of SomeOtherProcedure is:
Code:
procedure SomeOtherProcedure(Sender: TObject);
You can make this assignment:
Code:
Button1.OnClick := SomeOtherProcedure;
and when Button1 is clicked it will execute the definition of SomeOtherProcedure. Therefore, you can assign any procedure you like to an event if the parameter list matches. Also, you could have one validation procedure assigned to all buttons of a form if you wanted too.
Clive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.