/// <summary>
 /// checks if the cursor is over the client area
 /// and closes the container, if not
 /// </summary>
 private void ProcessMouseDown()
 {
     if (!_owner.Bounds.Contains(Control.MousePosition))
     {
         _owner.Close();
     }
 }
 protected override void WndProc(ref Message m)
 {
     if (m.Msg == Win32.WM_NCACTIVATE)
     {
         if (m.WParam.ToInt32() == 0)
         {
             m.WParam = new IntPtr(1);
         }
     }
     else if (m.Msg == Win32.WM_ACTIVATEAPP)
     {
         if (m.WParam.ToInt32() == 0)
         {
             _owner.Close();
         }
     }
     base.WndProc(ref m);
 }