Possible duplicate:
C # WinForm app - user interface freezes during long run
A C # Windows Forms application created an example run application.
My application works well, but when I tried to move the position of the application or collapse it, it freezes until the process is completed.
Please help: how to prevent my application from freezing?
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; } }
source share