Possible Duplicate:
C# WinForm Application - UI Hangs during Long-Running Operation
I've created a progress bar example application in C# Windows Forms.
My application runs well but when I tried to move my application position or minimize, it gets "hang" until it's process not complied.
Please help: how to prevent my application from "hang"?
This is my application code:
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;
}
}