ProgressChangedEventArgs.ProgressPercentage プロパティ
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
非同期タスクの進行状況の割合を取得します。
public:
property int ProgressPercentage { int get(); };
public int ProgressPercentage { get; }
member this.ProgressPercentage : int
Public ReadOnly Property ProgressPercentage As Integer
非同期タスクの進行状況を示す割合値。
次のコード例では、このメンバーの使用方法を示します。 この例では、イベント ハンドラーがイベントの PictureBox.LoadProgressChanged 発生を報告します。 このレポートは、イベントが発生したタイミングを知るのに役立ち、デバッグに役立ちます。 複数のイベントまたは頻繁に発生するイベントを報告するには、 を Console.WriteLine に置き換えるかMessageBox.Show、複数行TextBoxにメッセージを追加することを検討してください。
コード例を実行するには、 という名前PictureBox1
の型PictureBoxのインスタンスを含むプロジェクトに貼り付けます。 次に、イベント ハンドラーが イベントに関連付けられていることを確認します PictureBox.LoadProgressChanged 。
private void PictureBox1_LoadProgressChanged(Object sender, ProgressChangedEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ProgressPercentage", e.ProgressPercentage );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "UserState", e.UserState );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "LoadProgressChanged Event" );
}
Private Sub PictureBox1_LoadProgressChanged(sender as Object, e as ProgressChangedEventArgs) _
Handles PictureBox1.LoadProgressChanged
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "ProgressPercentage", e.ProgressPercentage)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "UserState", e.UserState)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"LoadProgressChanged Event")
End Sub
プロパティは ProgressPercentage 、非同期タスクが完了した割合を決定します。
製品 | バージョン |
---|---|
.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 | 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 |
UWP | 10.0 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。