/// <summary> /// Begin button drag /// </summary> /// <param name="selected">selected button</param> /// <param name="mousePosition">mouse position</param> /// <param name="cursor">cursor</param> /// <returns>true if button drag is started</returns> protected override bool BeginButtonDrag(UnitButton selected, Point mousePosition, ref Cursor cursor) { if (CanMoveByMouse == false) { return(true); } EventHandler <FormEventArgs> handler = UndockForm; if (handler != null) { _movedButton = selected; _movedForm = (Form)_movedButton.Page; _movedIndex = SelectedIndex; Point mouseScreenPosition = Control.MousePosition; FormEventArgs args = new FormEventArgs(_movedForm, GetPageInfo(_movedForm).Id); handler(this, args); RemoveButton(_movedButton); _movedDecorator = HierarchyUtility.GetFormsDecorator(_movedForm); IsFocused = false; _movedDecorator.IsFocused = true; _movedDecorator.BeginMovementByMouse(mouseScreenPosition); cursor = Cursors.SizeAll; } return(true); }