Docking/MDI for Windows Forms Forum

Posted 11 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 13.1.0310
Platform: .NET 4.0
Environment: Windows 7 (64-bit)


If you double click with the right mouse button on a "ToolWindowContainerTab" very rapidly, you can produce a NullReferenceException.
You can reproduce it with the docking demo in the sample browser.
It is not easy to reproduce, because you have to move the mouse while clicking.
Otherwise the context menu is shown.

System.NullReferenceException: object reference not set to an instance of an object.
   at ActiproSoftware.UIStudio.TabStrip.TabStripTab.OnMouseUp(MouseEventArgs e)
   at ActiproSoftware.WinUICore.UIElement.#jxe(MouseEventArgs #yhb)
   at ActiproSoftware.WinUICore.UIControl.OnMouseUp(MouseEventArgs e)
   at ActiproSoftware.UIStudio.TabStrip.TabStrip.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(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)

I can reproduce the issue in my application too.
Since the call-stack doesn't contain any of my code, I am wondering if there is a workaround.
A simple try-catch-block at the right place would be sufficient.

Best regards, Tobias Lingemann.

Comments (1)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Tobias,

We haven't been able to repro this but will add additional null ref checks in that method to prevent this from happening in the future.  In the meantime, you might be able to make a class that inherits TabStrip and put a try...catch in an OnMouseUp override that calls its base method.

Actipro Software Support

The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.