예제 #1
0
 private void Form_MouseMove(object sender, MouseEventArgs e)
 {
     if (!m_DragTrigger.IsEmpty && !m_DragTrigger.Contains(e.X, e.Y) && !m_DragControlResize)
     {
         Size offset = new Size(-e.X, Accordion.TITLEHEIGHT - e.Y);
         Main.StartPaletteFormMove(m_Palette, offset);
         m_DragTrigger = Rectangle.Empty;
     }
     else if (IsResizing && Controls.Count > 0)
     {
         // Currently resizing
         Size sz = m_ResizeOriginal + e.Location.Subtract(m_StartResize);
         if (sz.Width < 10 || sz.Height < 10)
         {
             return;
         }
         sz = m_Control.SizeFromSize(sz);
         if (sz.Equals(Controls[0].Size))
         {
             return;
         }
         Rectangle rct = new Rectangle(this.Left, this.Top, sz.Width + BORDER * 2, sz.Height + BORDER + Accordion.TITLEHEIGHT);
         GUIUtilities.CheckRectOnScreen(rct);
         Controls[0].Size = sz;
         this.Bounds      = rct;
         Invalidate(new Rectangle(0, 0, Width, Accordion.TITLEHEIGHT + BORDER));
     }
 }