CreateArgs(Control: IControl);
Control is a component over which the event of context menu calling should be generated.
The CreateArgs designer creates argument of the event that occurs when the context menu is called 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 calling over the ScrollBox1 component.
See also: