CreateArgs(Control: IControl);
Control - component, over which the event of context menu opening should be generated.
The CreateArgs constructor creates an argument of the event that occurs when the context menu opens over any component of the form.
Executing the example requires a form, a button named Button1, the PopupMenu component named PopupMenu1 and the ScrollBox component named ScrollBox1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Popup: IPopupMenuEventArgs;
Begin
Popup := New PopupMenuEventArgs.CreateArgs(ScrollBox1);
PopupMenu1.OnPopup(PopupMenu1, Popup);
End Sub Button1OnClick;
After executing the example pressing the button generates the event of context menu opening over the ScrollBox1 component.
See also: