Im not sure you can add an additional event for the OnClick
You would have to assign an OnClick to all items then separate them by
caption/name/tag whatever.
like this:
private
{ Private declarations }
Procedure ClickMyMenuItem(Sender : Tobject);
Procedure AssignMenuItemClickEvents;
...
procedure TForm1.ClickMyMenuItem(Sender : Tobject);
Begin
ShowMessage ('This is my Onclick handler');
End;
procedure TForm1.FormCreate(Sender: TObject);
begin
AssignMenuItemClickEvents;
end;
Procedure TForm1.AssignMenuItemClickEvents;
var
i,x: integer;
Begin
for i := 0 to ComponentCount - 1 do begin
if (Components[i] is TMenuItem) then
TMenuItem(Components[i]).OnClick := ClickMyMenuItem;
end;
End;
heromed <[EMAIL PROTECTED]> wrote: How can I add an additional event to
TPopUpMenu which would be
executed when any of the MenuItems were clicked on, and would return
the MenuItem that was selected ?
---------------------------------
Yahoo! Photos
Got holiday prints? See all the ways to get quality prints in your hands ASAP.
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/