protected void OnPageOver(TabStub sender, int pageIndex) { try { // Remove any showing auto hide windows except our own _manager.RemoveShowingAutoHideWindowsExcept(this); // No need for running timer, this action supercedes it StopDismissTimer(); // Hovering over a different TabStub? if (_currentWCT != sender.WindowContentTabbed) { // Remove any currently displayed Panel/WCT if (_currentWCT != null) RemoveDisplayedWindow(); } else { // Different tab in the same TabStub? if (pageIndex != _currentWCT.TabControl.SelectedIndex) { // Remove any currently displayed Panel/WCT if (_currentWCT != null) RemoveDisplayedWindow(); } else { // Hover over the current window, so do nothing return; } } Edge borderEdge = Edge.None; // Define which edge of the host panel shown have a border drawn switch(this.Dock) { case DockStyle.Left: borderEdge = Edge.Right; break; case DockStyle.Right: borderEdge = Edge.Left; break; case DockStyle.Top: borderEdge = Edge.Bottom; break; case DockStyle.Bottom: borderEdge = Edge.Top; break; } // Create a Panel that will host the actual WindowContentTabbed control, // the Panel is resized to slide into/from view. The WCT is a fixed size // within the Panel and so only the partial view of the WCT is shown and // at any point in time. Cannot resize the WCT into view as it would keep // repainting the caption details and effect and docking items inside it. _currentPanel = new AutoHostPanel(_manager, this, borderEdge); // Do not show it until we have resizing it as needed _currentPanel.Hide(); // Get access to the WindowContentTabbed that is to be hosted _currentWCT = sender.WindowContentTabbed; // Select the correct page for view in the WCT _currentWCT.TabControl.SelectedIndex = pageIndex; // Place the WCT inside the host Panel _currentPanel.Controls.Add(_currentWCT); // Now add the Panel to the container display _manager.Container.Controls.Add(_currentPanel); // Make it top of the Z-Order _manager.Container.Controls.SetChildIndex(_currentPanel, 0); // Define the remember and slide rectangle values DefineRectangles(); // Set the modified WCT size _currentWCT.Width = _slideRect.Width; _currentWCT.Height = _slideRect.Height; Size barSize = _currentPanel.ResizeBarSize(); // Set the initial size/location of Panel and hosted WCT switch(this.Dock) { case DockStyle.Left: _currentPanel.Size = new Size(0, this.Height); _currentPanel.Location = new Point(this.Right, this.Top); _currentWCT.Height = this.Height; break; case DockStyle.Right: _currentPanel.Size = new Size(0, this.Height); _currentPanel.Location = new Point(this.Left, this.Top); _currentWCT.Height = this.Height; break; case DockStyle.Top: _currentPanel.Size = new Size(this.Width, 0); _currentPanel.Location = new Point(this.Left, this.Bottom); _currentWCT.Width = this.Width; break; case DockStyle.Bottom: _currentPanel.Size = new Size(this.Width, 0); _currentPanel.Location = new Point(this.Left, this.Top); _currentWCT.Width = this.Width; break; } // Finally we are ready to show it _currentPanel.Show(); // We want to snoop of changes of focus to and from Panel and its children MonitorPanel(true); // We are showing and not hiding with the timer _slideOut = true; // Kick off the slide timer StartSlideTimer(); } catch(System.Exception ex) { MessageBox.Show(ex.Message); } }