ToolStripDropDown.Show メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した座標を基準に 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。