private void CursorCtrl(int x, int y) { if (!m_isMoving) { if (RecAdjustSize.Contains(x, y)) { this.Cursor = Cursors.SizeWE; } else { this.Cursor = Cursors.Default; } } }
protected override void OnMouseDown(MouseEventArgs e) { m_isMoving = true; m_offset = new Point(e.X, e.Y); m_intSize.Width = this.Width; m_intSize.Height = this.Height; if (RecAdjustSize.Contains(e.X, e.Y)) //调整大小 { this.Cursor = Cursors.SizeWE; m_adjust = EnumAdjust.Size; } else if (RecAdjustPostion.Contains(e.X, e.Y)) //调整位置 { this.Cursor = Cursors.SizeAll; m_adjust = EnumAdjust.Postion; } else { m_adjust = EnumAdjust.Nothing; } base.OnMouseDown(e); }