System.Windows.Forms.ContextMenu.Show Method

Displays the shortcut menu at the specified position.

Syntax

public void Show (Control control, System.Drawing.Point pos)

Parameters

control
A System.Windows.Forms.Control that specifies the control with which this shortcut menu is associated.
pos
A System.Drawing.Point that specifies the coordinates at which to display the menu. These coordinates are specified relative to the client coordinates of the control specified in the control parameter.

Remarks

Typically, a System.Windows.Forms.ContextMenu is displayed when the user clicks the right mouse button on a control or area of the form that the System.Windows.Forms.ContextMenu is bound to. You can use this method to manually display the shortcut menu at a specific location and bind it with a specific control. This method does not return until the menu is dismissed.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0