public DockContent() { m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString)); m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged); //Suggested as a fix by bensty regarding form resize this.ParentChanged += new EventHandler(DockContent_ParentChanged); }
public clsForm() { Application.DoEvents(); _ReportForm = false; m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString)); m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged); }
} //end HideOrCloseFrom /// <summary> /// 关闭或隐藏当前窗体 /// 仅DockState状态跟当前的DockState状态相同的窗体 /// </summary> /// <param name="content">当前窗体对象</param> void HideOrCloseFrom(DockContentHandler content, bool isClose) { if (content == null || content.DockState != this.DockState) { return; } if (isClose) { content.Close(); } else if (!content.IsHidden) { content.Hide(); } }
public bool checkDockDocument(String tableName) { //tableName = tableName.Replace("\0", string.Empty); IDockContent[] idockContentArray = this.dockPanel.DocumentsToArray(); foreach (IDockContent idockContent in idockContentArray) { DockContentHandler dockContentHandler = idockContent.DockHandler; if (dockContentHandler.TabText.Equals(tableName)) { //MessageBox.Show("[" + tableName + "] has already selected."); dockContentHandler.Activate(); return(true); } } return(false); }
/// <summary> /// Tile all dock panes in the active dock window /// </summary> /// <param name="dockStyle">Dock style</param> public void TileDocumentContent(DockStyle dockStyle) { DockWindow documentDockWindow = m_dockPanel.DockWindows[DockState.Document]; DockPane activePane = documentDockWindow.NestedPanes[0]; int count = m_dockPanel.DocumentsCount; foreach (IDockContent dockContent in m_dockPanel.Documents) { if (count > 1) { if (dockContent != null) { DockContentHandler dockContentHandler = dockContent.DockHandler; dockContentHandler.DockTo(activePane, dockStyle, -1, 1.0 / (double)count); } } count--; } }