public void DockControl(DockingControl control, int dockAtIndex, int dimension) { using (RedrawStopper stopRedraws = new RedrawStopper(this)) { DockControlContainer oldContainer = ControlHelpers.FindParentControl <DockControlContainer>(control); if (oldContainer != null && oldContainer != this) { oldContainer.RemoveControl(control); } AddControl(control, dockAtIndex, dimension); } Invalidate(true); }
public void FloatControl(Rectangle bounds) { using (RedrawStopper redrawStopper = new RedrawStopper(_manager.ParentForm, true)) { if (this.AutoHide) { this.AutoHide = false; } DockControlContainer oldContainer = _container; Form parentForm = this.ParentForm; if (oldContainer != null) { oldContainer.RemoveControl(this); } if (_floatingForm == null || parentForm != _floatingForm) { _floatingForm = new FloatingForm(this, _manager); _autoHidetoolStripButton.Visible = false; _tabsToolStripButton.Visible = false; } _floatingForm.Bounds = bounds; if (_floatingForm.Visible) { _floatingForm.Invalidate(); } else if (_floatingForm.Loaded) { _floatingForm.Visible = !this.Cancelled; } else if (!this.Cancelled) { _floatingForm.Show(parentForm); } } }