語言

ToolStripControlHost.Leave 活動

定義

當輸入焦點離開託管控制時,會發生這種情況。

public:
 event EventHandler ^ Leave;
public event EventHandler Leave;
public event EventHandler? Leave;
member this.Leave : EventHandler 
Public Custom Event Leave As EventHandler 

事件類型

範例

以下程式碼範例展示了此成員的使用方式。 在這個例子中,事件處理者會回報事件 Leave 的發生情況。 此報告能幫助您了解事件發生時間,並協助除錯。 若要報告多個事件或頻繁發生的事件,請考慮將MessageBox.Show訊息替換Console.WriteLine為或附加於多行TextBox

要執行範例程式碼,請將其貼到包含一個 ToolStripControlHost 名為 ToolStripControlHost1的實例的專案中。 然後確保事件處理程式與事件 Leave 相關聯。

private void ToolStripControlHost1_Leave(Object sender, EventArgs e) {

   MessageBox.Show("You are in the ToolStripControlHost.Leave event.");
}
Private Sub ToolStripControlHost1_Leave(sender as Object, e as EventArgs) _ 
     Handles ToolStripControlHost1.Leave

   MessageBox.Show("You are in the ToolStripControlHost.Leave event.")

End Sub

備註

如需處理事件的詳細資訊,請參閱 處理和引發事件

適用於

另請參閱