FormClosingEventHandler 代理人

定義

代表處理 FormClosing 事件的方法。

public delegate void FormClosingEventHandler(System::Object ^ sender, FormClosingEventArgs ^ e);
public delegate void FormClosingEventHandler(object sender, FormClosingEventArgs e);
public delegate void FormClosingEventHandler(object? sender, FormClosingEventArgs e);
type FormClosingEventHandler = delegate of obj * FormClosingEventArgs -> unit
Public Delegate Sub FormClosingEventHandler(sender As Object, e As FormClosingEventArgs)

參數

sender
Object

事件的 來源。

e
FormClosingEventArgs

FormClosingEventArgs A 包含事件資料。

備註

FormClosing事件發生在表單關閉之前,無論是使用者透過使用者介面(UI),或程式化方式透過呼叫方法Close(如在Form類別中)ExitApplication或在類別中關閉。 此活動可能會被取消。

當你建立 FormClosingEventHandler 代理人時,你就能確定處理事件的方法。 要將事件與你的事件處理器關聯,請將該代理的實例加入事件中。 事件處理程序會在事件發生時被呼叫,除非你移除代理。 欲了解更多關於事件處理代表的資訊,請參閱 「處理與提升事件」。

擴充方法

名稱 Description
GetMethodInfo(Delegate)

取得一個代表指定代理所代表方法的物件。

適用於

另請參閱