BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

dynamically created buttons OnClick event - how?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Roy Coates
Guest





PostPosted: Thu Mar 17, 2005 3:15 pm    Post subject: dynamically created buttons OnClick event - how? Reply with 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.

Any ideas?

Thanks,

Roy.



Back to top
Marco van de Voort
Guest





PostPosted: Thu Mar 17, 2005 3:35 pm    Post subject: Re: dynamically created buttons OnClick event - how? Reply with quote



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





PostPosted: Thu Mar 17, 2005 3:58 pm    Post subject: Re: dynamically created buttons OnClick event - how? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.