void DesignerPanel_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { IUISelectionService selectionServ = this.DesignedControl.Site.GetService(typeof(IUISelectionService)) as IUISelectionService; if (selectionServ == null) { return; } selectionServ.SetCursor(e.X, e.Y); if (_mouseDown) { if (_firstMove) { selectionServ.MouseDragBegin(this.DesignerPanel, e.X, e.Y); _firstMove = false; } else { selectionServ.MouseDragMove(e.X, e.Y); } } else if (selectionServ.SelectionInProgress) { selectionServ.MouseDragMove(e.X, e.Y); } }
protected override void OnMouseDragMove(int x, int y) { IUISelectionService selectionServ = this.GetService(typeof(IUISelectionService)) as IUISelectionService; if (selectionServ != null) { Point location = new Point(x, y); if (!selectionServ.SelectionInProgress) { location = this.SnapPointToGrid(new Point(x, y)); } selectionServ.MouseDragMove(location.X, location.Y); } }