/// <summary> /// this will dock the floaty control /// </summary> private void DockFloaty() { // bring dockhost to front first to prevent flickering _dockState.OrgDockHost.TopLevelControl.BringToFront(); Hide(); _dockState.Container.Visible = false; // hide it temporarely _dockState.Container.Parent = _dockState.OrgDockingParent; _dockState.Container.Dock = _dockState.OrgDockStyle; _dockState.Container.Bounds = _dockState.OrgBounds; _dockState.Handle.Visible = true; // show handle again _dockState.Container.Visible = true; // it's good, show it if (DockOnInside) { _dockState.Container.BringToFront(); // set to front } //show splitter if (_dockState.Splitter != null && _dockState.OrgDockStyle != DockStyle.Fill && _dockState.OrgDockStyle != DockStyle.None) { _dockState.Splitter.Parent = _dockState.OrgDockingParent; _dockState.Splitter.Dock = _dockState.OrgDockStyle; _dockState.Splitter.Visible = true; // show splitter if (DockOnInside) { _dockState.Splitter.BringToFront(); } else { _dockState.Splitter.SendToBack(); } } if (!DockOnInside) { _dockState.Container.SendToBack(); // set to back } _isFloating = false; if (Docking != null) { Docking.Invoke(this, new EventArgs()); } }
private void Label_MouseDown(object sender, MouseButtonEventArgs e) { try { Docking.Invoke(this); } catch (Exception) { } }