我在 C# Windows 窗体中创建了一个进度条示例应用程序。
我的应用程序运行良好,但是当我尝试移动应用程序位置或最小化时,它会“挂起”,直到它的进程不符合要求。
请帮助:如何防止我的应用程序“挂起”?
这是我的应用程序代码:
public partial class ProgressBar : Form
{
public ProgressBar()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int value;
for (value = 0; value != 10000000; value++)
progressBar1.Value = progressBar1.Value + 1;
MessageBox.Show("ProgressBar Full", "Done",
MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Close();
}
private void ProgressBar_Load(object sender, EventArgs e)
{
progressBar1.Maximum = 10000000;
}
}
Run Code Online (Sandbox Code Playgroud) 我只是想加载一个网页,我不想打开它.
我想在进度条中显示页面加载过程.
页面加载完成后,我想显示一条消息:"页面加载完成".
我使用了这段代码,但它打开了浏览器:
System.Diagnostics.Process.Start( "http://google.com");