List Info

Thread: RE: Re: Tmainmenu at runtime




RE: Re: Tmainmenu at runtime
country flaguser name
United States
2007-05-16 10:08:44

>Hey that?s a great idea and much easier
>But how can I access the caption of the selected (click) Items
>(ItemIndex? Tag?)
>That would be helpful ;)

You could set the OnClick event of all the menu selections to the
sample event handler. Set the TMenuItem.Tag to a different number
for each menu selection. In the click handler:

case TMenuItem(Sender).Tag of
1: {code for the first menu item};
2: {code for the second menu item};
end;

You can also examine TMenuItem(Sender).Caption directly.

if TMenuItem(Sender).Caption = 'Chutney and Blind' then begin
{Do Chutney and Blind routine}
end else if TMenuItem(Sender).Caption = 'Second menu selection' then begin
{Do Second menu routine}
end;

Glenn Lawler
www.incodesystems.com

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )