G
Guest
I have a problem about threading when using ShowDialog method.
I have 2 forms and first one opens second one as modal. Form2 (second form)
has a progress bar. Any suggesstion.
Thanks.
HEre is my code...
private void Form1_Load(object sender, System.EventArgs e)
{
Thread t = new Thread(new ThreadStart(test));
t.Start();
this.label1.Text = "12 3214 ";
}
private void test()
{
Form2 d = new Form2();
d.TopMost = true;
d.ShowDialog();
}
// Form2 code....
private void Form2_Load(object sender, System.EventArgs e)
{
for(int i = 0 ; i < 100 ; i++)
{
this.progressBar1.Value = i;
Thread.Sleep(50);
}
}
Thanks
I have 2 forms and first one opens second one as modal. Form2 (second form)
has a progress bar. Any suggesstion.
Thanks.
HEre is my code...
private void Form1_Load(object sender, System.EventArgs e)
{
Thread t = new Thread(new ThreadStart(test));
t.Start();
this.label1.Text = "12 3214 ";
}
private void test()
{
Form2 d = new Form2();
d.TopMost = true;
d.ShowDialog();
}
// Form2 code....
private void Form2_Load(object sender, System.EventArgs e)
{
for(int i = 0 ; i < 100 ; i++)
{
this.progressBar1.Value = i;
Thread.Sleep(50);
}
}
Thanks