Icon TContextMenuEvent

Unit: WebCtrls

TContextMenuEvent = function (Sender: TObject; Button: Integer;
      ShiftKey, CtrlKey, AltKey: Boolean; X,Y: Integer): Boolean of
      object

Available In: Client and Server Applications

The TContextMenuEvent type is a common event type that is used by controls to provide notification that the user has initiated a context menu operation.

The Sender parameter is the TControl instance that triggered the event. The Button parameter represents the ordinal button code of the mouse button pressed, and the ShiftKey, CtrlKey, AltKey parameters represent whether the Shift, Control, and/or Alt keys were also pressed. The X and Y parameters indicate the horizontal and vertical position of the mouse pointer, in pixels, relative to the bounds of the control that triggered the event.

The ordinal mouse button values are defined in the WebUI unit, and are as follows:

MB_NONE = 0;
MB_LEFT = 1;
MB_MIDDLE = 2;
MB_RIGHT = 3;

Return True from the event to allow the context menu to be displayed, or False to prevent the context menu from appearing.
Image