I am using glControl in a multi-document interface application using c#, VS2010 and .NET framework 4.0. Every child form type has its own glControl. I have not modified context sharing flag, so by default all child controls are sharing the same context. I show different views of the same model in child forms. The application works fine except when I activate an inactive child form (change active child control) mouse capture does not change. Any mouse action occurs in the glControl previously active. It looks like glControl does not release mouse capture even after the control is deactivated. Mouse action is transferred to the new active control if I resize or move it.
In each child form's Activate event handler I have added glControlx.MakeCurrent().
In each child form's DeActivate event handler I have added glControlx.Context.MakeCurrent(null).
Any idea why is this happening or how to fix it?