At runtime, you can check to see if the user has assigned an event handler to the button and then internally store their handler and call after your code.
 
Phil.
----- Original Message -----
Sent: Thursday, November 21, 2002 11:42 AM
Subject: [DUG]: [Q] Event Hooking.....

G'Day,

I was just curious about some approaches to achieve responding to the event of an embedded component in my component. Clear as mud? An example:

Lets say I have a component MyComponent that has a published property MyButton : TButton. Now I want to take some action when the user clicks the button assigned to MyButton. However any code that they have assigned to the click event for the button must also be fired.

So basically I want to transparently hook the OnClick event. The only way I can think of doing this is by responding to the apropriate CN_*, CM_* message. Is there another way to do this? If not what messages should I be looking at responding to?


-- Donovan
----------------------------------------------------------------------
Donovan J. Edye [
www.edye.wattle.id.au]
Namadgi Systems [
www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': "...Uh Oh...."
----------------------------------------------------------------------
GXExplorer [
http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
----------------------------------------------------------------------

Reply via email to