Author: Tomas Rutkauskas
How can the event handler of a popup menu item determine which component was
right-clicked upon to activate that menu?
Use the PopupMenu.PopupComponent property to determine what control the menu was
1 procedure TForm1.PopupItem1Click(Sender: TObject);
2 begin3 Label1.Caption := PopupMenu1.PopupComponent.ClassName;
The form's ActiveControl property can also be used, however, the active control may not necessarily be the control that caused the popup menu to appear.