G
Guest
I have a C# MDI app. The child forms do alot of work, so this work is
perfomed on a different thread created using ThreadPool.QueueUserWorkItem().
Because the status of the work is important to the user, I post the results
in a richTextBox on the child form. I have created an event to do this since
it is best to update the controls using the thread that they were created
with (or so I've read).
Anyway, the first time the user selects a form and starts the work (pushes
start button), everything is fine. However, if the user closes the form and
then reopens it and restarts the test, the following exception is thrown ...
"System.ObjectDisposedException" ... "Cannot access a disposed object named
"RichTextBox".".
The child form is created using this code...
private void menuItemTestMultiple_Click(object sender, System.EventArgs e)
{
dlgDATestMult = new MultiplePass(ParentWindow);
dlgDATestMult.Show();
}
The richTextBox I speak of was created using the forms designer.
Any ideas?
Thanks in advance
perfomed on a different thread created using ThreadPool.QueueUserWorkItem().
Because the status of the work is important to the user, I post the results
in a richTextBox on the child form. I have created an event to do this since
it is best to update the controls using the thread that they were created
with (or so I've read).
Anyway, the first time the user selects a form and starts the work (pushes
start button), everything is fine. However, if the user closes the form and
then reopens it and restarts the test, the following exception is thrown ...
"System.ObjectDisposedException" ... "Cannot access a disposed object named
"RichTextBox".".
The child form is created using this code...
private void menuItemTestMultiple_Click(object sender, System.EventArgs e)
{
dlgDATestMult = new MultiplePass(ParentWindow);
dlgDATestMult.Show();
}
The richTextBox I speak of was created using the forms designer.
Any ideas?
Thanks in advance