jhlim 20240202_2
This commit is contained in:
28
DDUtilityApp/MESDOWNLOADER/ProgressForm.cs
Normal file
28
DDUtilityApp/MESDOWNLOADER/ProgressForm.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DDUtilityApp.MESDOWNLOADER
|
||||
{
|
||||
public partial class ProgressForm : Form
|
||||
{
|
||||
public ProgressForm(int maxFiles)
|
||||
{
|
||||
InitializeComponent();
|
||||
progressBar.Maximum = maxFiles + 1;
|
||||
lblStatus.Text = string.Empty;
|
||||
}
|
||||
|
||||
public void UpdateProgress(string fileName, int current)
|
||||
{
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(new Action(() => UpdateProgress(fileName, current)));
|
||||
}
|
||||
else
|
||||
{
|
||||
lblStatus.Text = $"{fileName}\r\n{current} / {progressBar.Maximum - 1}";
|
||||
progressBar.Value = current;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user