BackgroundWorker.WorkerReportsProgress 屬性

定義

取得或設定值,指出 BackgroundWorker 是否可以報告進度更新。

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

屬性值

如果 BackgroundWorker 支援進度更新,則為 true,否則為 false。 預設為 false

備註

如果您要BackgroundWorker支援進度更新,請將 WorkerReportsProgress 屬性true設定為 。 當這個屬性為 true時,使用者程式代碼可以呼叫 ReportProgress 方法來引發 ProgressChanged 事件。

適用於

另請參閱