The Sender will be the menu item. Try   TAction(TActionClientItem 
(Sender).Action).Caption.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Errol Anderson
Sent: Thursday, 21 December 2017 9:47 am
To: [email protected]
Subject: [DUG] How to find parameters of an Action Menu created at runtime


My program creates Action Menu items at runtime, with the caption of each item 
set to a value returned by a database query. The OnExecute procedure is the 
same for all items.

When I click on an item, I need to obtain the item caption for the OnExecute 
procedure, to use in another query. I have tried the following (analogous to 
TMenuItem for a popup menu):

sCaption := TActionClientItem(Sender).Caption;

However, this always returns an empty string. I have searched the web and the 
Delphi Help to no avail. I am aware that Caption is a published property, but 
the public property Index also fails.

I presume I am doing something wrong here, but cannot figure out what. Any help 
appreciated.
Regards

Errol Anderson
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to