BackgroundWorker.WorkerSupportsCancellation 屬性

定義

取得或設定值,指出 BackgroundWorker 是否支援非同步取消。

public:
 property bool WorkerSupportsCancellation { bool get(); void set(bool value); };
public bool WorkerSupportsCancellation { get; set; }
member this.WorkerSupportsCancellation : bool with get, set
Public Property WorkerSupportsCancellation As Boolean

屬性值

如果 BackgroundWorker 支援取消,則為 true,否則為 false。 預設為 false

備註

如果您要BackgroundWorker支援取消,請將 WorkerSupportsCancellation 屬性true設定為 。 當這個屬性為 true時,您可以呼叫 CancelAsync 方法來中斷背景作業。

適用於

另請參閱