Esempio n. 1
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (_windowMove)
         Location = PointToScreen(e.Location) - _windowMoveDelta;
     else
         _resizeShow = GetResizeAt(e.Location);
 }
Esempio n. 2
0
        public void SetResize(ControlResizeTypes resize)
        {
            resizeType = resize;
            _resizeDelta = MousePosition;
            _resizeOriginal = Size;
            _resizePosition = PointToScreen(Point.Zero);

            switch (resize)
            {
                case ControlResizeTypes.None:
                    resizeActive = false;
                    Application.activeResizeControl = null;
                    break;

                default:
                    resizeActive = true;
                    Application.activeResizeControl = this;
                    break;
            }
        }
Esempio n. 3
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if (e.Button == MouseButtons.Left)
            {
                resizeType = GetResizeAt(e.Location);
                SetResize(resizeType);

                if (resizeType == ControlResizeTypes.None)
                {
                    // Move then.
                    if (Movable)
                        if (e.Location.Y < HeaderHeight)
                        {
                            _windowMoveDelta = e.Location;
                            _windowMove = true;
                        }
                }
            }
        }
Esempio n. 4
0
        private void _Application_UpClick(object sender, MouseEventArgs e)
        {
            _windowMove = false;
            resizeType = ControlResizeTypes.None;
            if (Application.activeResizeControl == this)
                Application.activeResizeControl = null;

            resizeActive = false;
        }