Posted 20 years ago
by tony_coupland

Hi,
I have a main application which contains the DocumentManger, I have a child form (inheriting UserControl) contained in a non-dockable toolwindow which display as a dialog box. Is it possible to close (hide) this dialog box (toolwindow) from itself?
I have a command button on the dialog which sends a message to the mainform (with itself as a parameter) which then looks up the ToolWindow assoicated and sends the hide command to it. The system then causes the exception 'System.NullReferenceException' within the control.
From the other threads on here it seems that the child windows are closed from the thread running the main form (with the DocumentManager), is this where my problem comes from?
I can put together a sample set of code to illustrate this if it doesnt make sence.
Regards,
Tony Coupland
I have a main application which contains the DocumentManger, I have a child form (inheriting UserControl) contained in a non-dockable toolwindow which display as a dialog box. Is it possible to close (hide) this dialog box (toolwindow) from itself?
I have a command button on the dialog which sends a message to the mainform (with itself as a parameter) which then looks up the ToolWindow assoicated and sends the hide command to it. The system then causes the exception 'System.NullReferenceException' within the control.
From the other threads on here it seems that the child windows are closed from the thread running the main form (with the DocumentManager), is this where my problem comes from?
I can put together a sample set of code to illustrate this if it doesnt make sence.
Regards,
Tony Coupland