S
Steve Sargent
Hi:
I'm writing an application that needs to be able to close a child
window when it receives an event from a server. The child window is
displayed as a dialog box.
Currently, I've tried using the Close() method on the dialog box from
the owner window, but it isn't having the effect I want. Basically,
the window freezes and I get an unhandled exception with the degugger
pointing at the ShowDialog() call.
<An unhandled exception of type 'System.ObjectDisposedException'
occurred in system.windows.forms.dll
Additional information: Cannot access a disposed object named
"GroupBox".>
If I let the dialog box close on it's own, It will be referencing
items that have already been disposed.
What is the proper way to programmatically kill a dialog box, if there
is one.
Thanks in advance for any help given.
Steve
I'm writing an application that needs to be able to close a child
window when it receives an event from a server. The child window is
displayed as a dialog box.
Currently, I've tried using the Close() method on the dialog box from
the owner window, but it isn't having the effect I want. Basically,
the window freezes and I get an unhandled exception with the degugger
pointing at the ShowDialog() call.
<An unhandled exception of type 'System.ObjectDisposedException'
occurred in system.windows.forms.dll
Additional information: Cannot access a disposed object named
"GroupBox".>
If I let the dialog box close on it's own, It will be referencing
items that have already been disposed.
What is the proper way to programmatically kill a dialog box, if there
is one.
Thanks in advance for any help given.
Steve