A. Use the PopupComponent property of the PopupMenu component to determine what control was right clicked.
procedure TForm1.PopupItem1Click(Sender: TObject);
begin
Label1.Caption := PopupMenu1.PopupComponent.ClassName;
end;
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.