コード例 #1
0
        /// <summary>
        /// On mouse move over title right margin
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event arg</param>
        private void OnMouseMoveInRightMargin(object sender, MouseEventArgs e)
        {
            if (_sizeMode == zSizeMode.Right)
            {
                Point location = RightMargin.PointToScreen(e.Location);
                int   dx       = location.X - _mouseDownScreenPos.X;

                Positioner.Size = new Size(
                    _positionerSizeOnMouseDown.Width + dx,
                    Positioner.Size.Height);
            }
        }
コード例 #2
0
        /// <summary>
        /// On mouse down in title right margin
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event arg</param>
        private void OnMouseDownInRightMargin(object sender, MouseEventArgs e)
        {
            _sizeMode = zSizeMode.None;

            if (e.Button == MouseButtons.Left && Positioner.CanSizeRight && CanResizeByMouse)
            {
                _mouseDownScreenPos            = RightMargin.PointToScreen(e.Location);
                _positionerPositionOnMouseDown = Positioner.Location;
                _positionerSizeOnMouseDown     = Positioner.Size;
                _sizeMode = zSizeMode.Right;
            }
        }