Control: IControl;
The Control property returns the component, over which the context menu was opened.
Executing the example requires a form, the PopupMenu component named PopupMenu1, for which this procedure is set as a handler of the OnPopup event. Several visual components are also placed on the form. The PopupMenu property is set to the PopupMenu1 component for all visual components and for a form.
Sub PopupMenu1OnPopup(Sender: Object; Args: IPopupMenuEventArgs);
Begin
Debug.WriteLine(Args.Control.Name);
End Sub PopupMenu1OnPopup;
After implementation of the event the name of the object, over which the context menu opened, is displayed in the console.
See also: