I have a program I wrote in C# with a window.
I have a button that do some things (it doesn't matter what exactly) and it refresh the window in his loop (in button_click function) (with this.Invalidate(false); (I don't use this.Refresh because I have a groupBox that I don't want to refresh)).
I cant minimize the window while the button_click function working. there is something I can do to solve it?
**lets say I have this code:
void button_click(object sender, EventArgs e)
{
progressBar1.Value = 0;
progressBar1.Maximum = int.Parse(somelabel_num.Text);
int i;
OpenFileDialog file = new OpenFileDialog();
file.ShowDialog();
if (file.FileName == "")
return;
this.Refresh();
Bitmap image = new Bitmap(file.FileName);
groupBox1.BackgroundImage = image;
for (i = 0; i < int.Parse(somelabel_num.Text); i++)
{
this.Text = i;
this.Invalidate(false);
progressBar1.PerformStep();
}
}
so how to do this as a thread that gets the paremeters?