ToolStripDropDown.Show メソッド

定義

指定した座標を基準として ToolStripDropDown を相対的に配置します。

オーバーロード

Show()

ToolStripDropDown コントロールを既定の位置に表示します。

Show(Point)

指定した画面位置を基準として ToolStripDropDown を相対的に配置します。

Show(Point, ToolStripDropDownDirection)

指定したコントロールを基準として、親コントロールをベースとする指定の方向に、ToolStripDropDown を相対的に配置します。

Show(Int32, Int32)

指定した画面座標を基準として ToolStripDropDown を相対的に配置します。

Show(Control, Point)

指定したコントロールの位置を基準として ToolStripDropDown を相対的に配置します。

Show(Control, Point, ToolStripDropDownDirection)

指定した位置にある指定したコントロールを基準として、親コントロールをベースとする指定の方向に、ToolStripDropDown を相対的に配置します。

Show(Control, Int32, Int32)

指定したコントロールの水平および垂直画面座標を基準として、ToolStripDropDown を相対的に配置します。

Show()

ToolStripDropDown コントロールを既定の位置に表示します。

public:
 void Show();
[System.ComponentModel.Browsable(false)]
public void Show ();
[<System.ComponentModel.Browsable(false)>]
override this.Show : unit -> unit
Public Sub Show ()
属性

次のコード例では、コントロールを既定の位置に表示する ToolStripDropDown 方法を示します。

// This method calls the ToolStripDropDown control's Show 
// method to display the ContextMenuStrip in its 
// default location.
private void showButton_Click(object sender, EventArgs e)
{
    this.contextMenuStrip1.Show();
}
' This method calls the ToolStripDropDown control's Show 
' method to display the ContextMenuStrip in its 
' default location.
Private Sub showButton_Click(sender As Object, e As EventArgs) Handles showButton.Click
   Me.contextMenuStrip1.Show()
 End Sub

適用対象

Show(Point)

指定した画面位置を基準として ToolStripDropDown を相対的に配置します。

public:
 void Show(System::Drawing::Point screenLocation);
public void Show (System.Drawing.Point screenLocation);
override this.Show : System.Drawing.Point -> unit
Public Sub Show (screenLocation As Point)

パラメーター

screenLocation
Point

画面左上隅の水平方向および垂直方向の位置 (ピクセル単位)。

次のコード例では、コントロールを固定ポイントで表示する ToolStripDropDown 方法を示します。

// This method calls the ToolStripDropDown control's Show 
// method to display the ContextMenuStrip at a fixed point.
private void showAtPointButton_Click(object sender, EventArgs e)
{
    this.contextMenuStrip1.Show(23, 55);
}
' This method calls the ToolStripDropDown control's Show 
' method to display the ContextMenuStrip at a fixed point.
Private Sub showAtPointButton_Click(sender As Object, e As EventArgs) Handles showAtPointButton.Click, button2.Click
   Me.contextMenuStrip1.Show(23, 55)
 End Sub

適用対象

Show(Point, ToolStripDropDownDirection)

指定したコントロールを基準として、親コントロールをベースとする指定の方向に、ToolStripDropDown を相対的に配置します。

public:
 void Show(System::Drawing::Point position, System::Windows::Forms::ToolStripDropDownDirection direction);
public void Show (System.Drawing.Point position, System.Windows.Forms.ToolStripDropDownDirection direction);
override this.Show : System.Drawing.Point * System.Windows.Forms.ToolStripDropDownDirection -> unit
Public Sub Show (position As Point, direction As ToolStripDropDownDirection)

パラメーター

position
Point

参照先コントロールの左上隅の水平方向および垂直方向の位置 (ピクセル単位)。

direction
ToolStripDropDownDirection

ToolStripDropDownDirection 値のいずれか 1 つ。

次のコード例では、指定した方向の ToolStripDropDown 固定ポイントにコントロールを表示する方法を示します。

// This method calls the ToolStripDropDown control's Show 
// method to display the ContextMenuStrip relative to the
// origin of the form. 
private void showRelativeButton_Click(object sender, EventArgs e)
{
    this.contextMenuStrip1.Show(this.Location, this.dropDownDirection);
}
' This method calls the ToolStripDropDown control's Show 
' method to display the ContextMenuStrip relative to the
' origin of the form. 
Private Sub showRelativeButton_Click(sender As Object, e As EventArgs)
   Me.contextMenuStrip1.Show(Me.Location, Me.dropDownDirection)
 End Sub

適用対象

Show(Int32, Int32)

指定した画面座標を基準として ToolStripDropDown を相対的に配置します。

public:
 void Show(int x, int y);
public void Show (int x, int y);
override this.Show : int * int -> unit
Public Sub Show (x As Integer, y As Integer)

パラメーター

x
Int32

水平画面座標 (ピクセル単位)。

y
Int32

垂直画面座標 (ピクセル単位)。

適用対象

Show(Control, Point)

指定したコントロールの位置を基準として ToolStripDropDown を相対的に配置します。

public:
 void Show(System::Windows::Forms::Control ^ control, System::Drawing::Point position);
public void Show (System.Windows.Forms.Control control, System.Drawing.Point position);
override this.Show : System.Windows.Forms.Control * System.Drawing.Point -> unit
Public Sub Show (control As Control, position As Point)

パラメーター

control
Control

ToolStripDropDownButton の位置の参照点となるコントロール (通常は ToolStripDropDown)。

position
Point

参照先コントロールの左上隅の水平方向および垂直方向の位置 (ピクセル単位)。

例外

control パラメーターによって指定されたコントロールが null です。

適用対象

Show(Control, Point, ToolStripDropDownDirection)

指定した位置にある指定したコントロールを基準として、親コントロールをベースとする指定の方向に、ToolStripDropDown を相対的に配置します。

public:
 void Show(System::Windows::Forms::Control ^ control, System::Drawing::Point position, System::Windows::Forms::ToolStripDropDownDirection direction);
public void Show (System.Windows.Forms.Control control, System.Drawing.Point position, System.Windows.Forms.ToolStripDropDownDirection direction);
override this.Show : System.Windows.Forms.Control * System.Drawing.Point * System.Windows.Forms.ToolStripDropDownDirection -> unit
Public Sub Show (control As Control, position As Point, direction As ToolStripDropDownDirection)

パラメーター

control
Control

ToolStripDropDownButton の位置の参照点となるコントロール (通常は ToolStripDropDown)。

position
Point

参照先コントロールの左上隅の水平方向および垂直方向の位置 (ピクセル単位)。

direction
ToolStripDropDownDirection

ToolStripDropDownDirection 値のいずれか 1 つ。

例外

control パラメーターによって指定されたコントロールが null です。

次のコード例では、親コントロールを基準にしてコントロールを ToolStripDropDown 表示する方法を示します。

// This method calls the ToolStripDropDown control's Show 
// method to display the ContextMenuStrip relative to the
// owning control.
private void button1_MouseUp(object sender, MouseEventArgs e)
{
    Control c = sender as Control;
    if (e.Button == MouseButtons.Right)
    {
        this.contextMenuStrip1.Show(c, e.Location, this.dropDownDirection);
    }
}
' This method calls the ToolStripDropDown control's Show 
' method to display the ContextMenuStrip relative to the
' owning control.
Private Sub button1_MouseUp(sender As Object, e As MouseEventArgs) Handles button1.MouseUp
     Dim c As Control = CType(sender, Control)
   
     If e.Button = Windows.Forms.MouseButtons.Right Then
         Me.contextMenuStrip1.Show(c, e.Location, Me.dropDownDirection)
     End If
 End Sub

適用対象

Show(Control, Int32, Int32)

指定したコントロールの水平および垂直画面座標を基準として、ToolStripDropDown を相対的に配置します。

public:
 void Show(System::Windows::Forms::Control ^ control, int x, int y);
public void Show (System.Windows.Forms.Control control, int x, int y);
override this.Show : System.Windows.Forms.Control * int * int -> unit
Public Sub Show (control As Control, x As Integer, y As Integer)

パラメーター

control
Control

ToolStripDropDownButton の位置の参照点となるコントロール (通常は ToolStripDropDown)。

x
Int32

コントロールの水平画面座標 (ピクセル単位)。

y
Int32

コントロールの垂直画面座標 (ピクセル単位)。

例外

control パラメーターによって指定されたコントロールが null です。

適用対象