There is a NullReferenceException when disposing and control has focus.
When disposing, the FieldControls and LabelControls are disposed.
The base.Dispose(disposing) is then called.
A NullReferenceException is thrown from inside the base.Dispose().
_Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at IPAddressControlLib.IPAddressControl.get_Focused()
at IPAddressControlLib.IPAddressControl.OnLostFocus(EventArgs e)
at System.Windows.Forms.Control.WmKillFocus(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.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)_
It appears that get_Focused() accesses the null _fieldControls causing the exception.
There is a NullReferenceException when disposing and control has focus.
When disposing, the FieldControls and LabelControls are disposed. The base.Dispose(disposing) is then called.
A NullReferenceException is thrown from inside the base.Dispose().
_Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at IPAddressControlLib.IPAddressControl.get_Focused() at IPAddressControlLib.IPAddressControl.OnLostFocus(EventArgs e) at System.Windows.Forms.Control.WmKillFocus(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.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)_
It appears that get_Focused() accesses the null _fieldControls causing the exception.