Board index » delphi » Events for run-time created components

Events for run-time created components

Q: I know now how to create components at run-time.
   If I only could use it's events.

Could somebody help me in this

Bye Bye and thanx in advance,

Eddy "Clueless" Hendriks

 

Re:Events for run-time created components


Quote
In article <51th5g$...@studs2.sci.kun.nl> edw...@sci.kun.nl (Edwin Hendriks) writes:
>From: edw...@sci.kun.nl (Edwin Hendriks)
>Subject: Events for run-time created components
>Date: 20 Sep 1996 09:29:52 +0200
>Keywords: run-time created components, events
>Q: I know now how to create components at run-time.
>   If I only could use it's events.
>Could somebody help me in this
>Bye Bye and thanx in advance,
>Eddy "Clueless" Hendriks

You need

1) to create the procedure / eventhandler, with the same params as the
control expects. Declare this in the "public" section of the form's methods,
not above Private ie you "own" it, not the IDE.

2) When you create your new component, simply set it's event to this handler /
proc eg

   newbtn.onclick := MyCustomButtonOnClickHandler;

HTH

Boris Ingram, Cyborg Software
boris...@iafrica.com
100076.3...@compuserve.com
http://www.pcb.co.za/users/borising/cyborg.htm

Other Threads