Author: William Gerbert
Disabling an event handler once it has executed once
Answer:
Have you ever wanted to keep an event from firing once it has executed once? Simply
set the event handler method to nil in the body of the method. For instance, let's
say you want to disable an OnClick for a button once the user has pressed it.
Here's the code to do that:
1 procedure Button1OnClick;
2 begin3 Button1.OnClick := nil;
4 end;