I have run into a problem when attempting to show a floating form that has been hidden. I was under the impression that SetDockVisibility() was responsible for setting the visibility of floating controls as well as docked controls, however I am getting a NullReferenceException when calling SetDockVisibility() on a control that has been floated.
When the control is hidden by clicking the Close button in the upper right corner of the floating form and then I try to make the form visible again using SetDockVisibility(), the following exception is thrown:
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Windows.Forms.Tools.FloatingForm.UpdateFormBorderStyle()
at Syncfusion.Windows.Forms.Tools.FloatingForm.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at Syncfusion.Windows.Forms.Tools.FloatingForm.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Is there a solution or work around for this? Is this even the proper way of making a floating form visible again after closing it?
I am using Syncfusion v7.3.0.20.
I have been using sample code provided by Syncfusion from an old forum post:
http://websamples.syncfusion.com/samples/Tools.Windows/F70639/main.htm