Reduce refresh UI controls

This commit is contained in:
Glavo 2022-02-08 12:23:32 +08:00 committed by Yuhui Huang
parent ca2eccc762
commit a5ebf08a8c

View File

@ -171,12 +171,12 @@ $form.Controls.Add($layout)
$progressBar.Value = [int][System.Math]::Truncate($percentage)
$label.Text = [string]::Format("{0:0.00}%", $percentage)
$label.Refresh()
}
[System.ComponentModel.AsyncCompletedEventHandler]$downloadFileCompletedEventHandler = {
param($sender, [System.ComponentModel.AsyncCompletedEventArgs]$CompletedEventArgs)
if (!$form.IsDisposed) {
$label.Refresh()
if ($CompletedEventArgs.Cancelled) {
$form.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
} elseif ($CompletedEventArgs.Error -ne $null) {