   binding to eventhandler
  I am using delphi 6I have created a button and an editbox in runtime, but how do i bind them to a eventhandler at runtime? So that i can push on thje button and do something.thanx in advance 
  The event handler will usually be of the type "TNotifyEvent" (look it up in the help files).  This is just a procedure, bound to an object (i.e., not a free-standing one but a class member, gotta be a class member), which expects a single parameter -- the sender, of type TObject.So, let's do an example for you:type  TBlah = class  private    procedure TheEventHandler(Sender: TObject);  protected  public  end;procedure TBlah.TheEventHandler(Sender: TObject);begin  ShowMessage('Peekaboo');end;   The above class has a procedure called TheEventHandler, which matches the criteria of a TNotifyEvent (it's bound to an object and it accepts a single parameter).Attaching this handler to an object is as simple as (somewhere in the TBlah class):MyTButton.whenclickedon := TheEventHandler;   If you want to remove the event handler, you assign it nil:MyTButton.whenclickedon := nil;   You can check whether an event handler is assigned using the Assigned function, which is a very handy thing indeed.EDIT: Replace "whenclickedon" with the obvious event -- the forum screwed up the word.   [edited by - Alimonster on February 11, 2004 9:56:09 AM];  yes that was what i were looking for.Thanx a lot! 