S
sadegh
Hi,
I have a problem with my Progressbar Form. the following code runs
correctly. But...
progressForm = new fclsProgress();
progressForm.percent = 0;
Thread doSomethingThread = new Thread(delegate()
{
for (int i=0; i<100; i++)
{
if (progressForm.cancel == true)
break;
progressForm.percent = i;
// ... do something
}
MyNamespace.MyClass.ActiveForm.Invoke((MethodInvoker)delegate
{ this.progressForm.Close(); });
}
doSomethingThread.Start();
progressForm.ShowDialog();
But when I minimize my program, It is stoped by the following error
message:
"Object reference not set to an instance of an object"
on line:
MyNamespace.MyClass.ActiveForm.Invoke((MethodInvoker)delegate
{ this.progressForm.Close(); });
Every help would be appreciated.
I have a problem with my Progressbar Form. the following code runs
correctly. But...
progressForm = new fclsProgress();
progressForm.percent = 0;
Thread doSomethingThread = new Thread(delegate()
{
for (int i=0; i<100; i++)
{
if (progressForm.cancel == true)
break;
progressForm.percent = i;
// ... do something
}
MyNamespace.MyClass.ActiveForm.Invoke((MethodInvoker)delegate
{ this.progressForm.Close(); });
}
doSomethingThread.Start();
progressForm.ShowDialog();
But when I minimize my program, It is stoped by the following error
message:
"Object reference not set to an instance of an object"
on line:
MyNamespace.MyClass.ActiveForm.Invoke((MethodInvoker)delegate
{ this.progressForm.Close(); });
Every help would be appreciated.