CancelEventHandler 代理人
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示處理可取消事件的方法。
public delegate void CancelEventHandler(System::Object ^ sender, CancelEventArgs ^ e);
C#
public delegate void CancelEventHandler(object sender, CancelEventArgs e);
C#
public delegate void CancelEventHandler(object? sender, CancelEventArgs e);
type CancelEventHandler = delegate of obj * CancelEventArgs -> unit
Public Delegate Sub CancelEventHandler(sender As Object, e As CancelEventArgs)
- sender
- Object
事件的來源。
CancelEventArgs,其中包含事件資料。
如需如何使用委派的 CancelEventHandler 範例,請參閱 類別 CancelEventArgs 中的範例程序代碼。
建立 CancelEventHandler 委派時,必須識別處理事件的方法。 若要使事件與您的事件處理常式產生關聯,請將委派的執行個體 (Instance) 加入至事件。 除非移除委派,否則每當事件發生時都會呼叫事件處理程式方法。 如需事件處理程式委派的詳細資訊,請參閱 處理和引發事件。
Get |
取得表示特定委派所代表之方法的物件。 |
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |