 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Roy Coates Guest
|
Posted: Thu Mar 17, 2005 3:15 pm Post subject: dynamically created buttons OnClick event - how? |
|
|
I create a bunch of Tbuttons at runtime, and have a single routine which
handles any button being pressed, hoping that I could use the 'tag' value to
determine which button was pressed.
However, in my clicked handler, attempting to use:-
with sender as TButton do mytag:=Sender.tag;
is not permitted.
Any ideas?
Thanks,
Roy.
|
|
| Back to top |
|
 |
Marco van de Voort Guest
|
Posted: Thu Mar 17, 2005 3:35 pm Post subject: Re: dynamically created buttons OnClick event - how? |
|
|
On 2005-03-17, Roy Coates <r.coates (AT) liv (DOT) ac.uk> wrote:
| Quote: | I create a bunch of Tbuttons at runtime, and have a single routine which
handles any button being pressed, hoping that I could use the 'tag' value to
determine which button was pressed.
However, in my clicked handler, attempting to use:-
with sender as TButton do mytag:=Sender.tag;
is not permitted.
|
mytag:=(sender as TButton).tag
|
|
| Back to top |
|
 |
Roy Coates Guest
|
Posted: Thu Mar 17, 2005 3:58 pm Post subject: Re: dynamically created buttons OnClick event - how? |
|
|
Marco - you hero!
Thank so so much. My program works a treat now :-)
Regards,
Roy.
"Marco van de Voort" <marcov (AT) stack (DOT) nl> wrote
| Quote: | On 2005-03-17, Roy Coates <r.coates (AT) liv (DOT) ac.uk> wrote:
I create a bunch of Tbuttons at runtime, and have a single routine which
handles any button being pressed, hoping that I could use the 'tag'
value to
determine which button was pressed.
However, in my clicked handler, attempting to use:-
with sender as TButton do mytag:=Sender.tag;
is not permitted.
mytag:=(sender as TButton).tag
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|