ToolStripDropDown.Close 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
關閉 ToolStripDropDown 控制。
多載
| 名稱 | Description |
|---|---|
| Close(ToolStripDropDownCloseReason) |
為了指定原因關閉 ToolStripDropDown 控制點。 |
| Close() |
關閉 ToolStripDropDown 控制。 |
Close(ToolStripDropDownCloseReason)
為了指定原因關閉 ToolStripDropDown 控制點。
public:
void Close(System::Windows::Forms::ToolStripDropDownCloseReason reason);
public void Close(System.Windows.Forms.ToolStripDropDownCloseReason reason);
member this.Close : System.Windows.Forms.ToolStripDropDownCloseReason -> unit
Public Sub Close (reason As ToolStripDropDownCloseReason)
參數
- reason
- ToolStripDropDownCloseReason
這是其中一項 ToolStripDropDownCloseReason 價值。
範例
以下程式碼範例示範如何在明確關閉 ToolStripDropDown 控制項時 Close 指定接近原因。
// This method explicitly closes the ToolStripDropDown control
// and specifies the reason for closing as CloseCalled.
private void closeButton_Click(object sender, EventArgs e)
{
this.contextMenuStrip1.Close(ToolStripDropDownCloseReason.CloseCalled);
}
' This method explicitly closes the ToolStripDropDown control
' and specifies the reason for closing as CloseCalled.
Private Sub closeButton_Click(sender As Object, e As EventArgs) Handles closeButton.Click
Me.contextMenuStrip1.Close(ToolStripDropDownCloseReason.CloseCalled)
End Sub
備註
在特定條件下,例如啟動應用程式或點擊控制鍵選取項目時,使用此 Close 方法 ToolStripDropDown 關閉控制項,焦點改變,或指定鍵盤動作發生時。
另請參閱
適用於
Close()
關閉 ToolStripDropDown 控制。
public:
void Close();
public void Close();
member this.Close : unit -> unit
Public Sub Close ()