PopupMenuEventArgs.CreateArgs

Syntax

CreateArgs(Control: IControl);

Parameters

Control. The component, for which the context menu open event will be generated.

Description

The CreateArgs constructor creates an argument of the event that occurs when the context menu opens over any component of the form.

Example

Executing the example requires a form, a button named Button1 on the form, 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, clicking the button generates the event of context menu open for the ScrollBox1 component.

See also:

PopupMenuEventArgs