private void CreateTabPage(PageNode node) { TabPage page = this.tabControl.TabPages[node.Id.ToString()]; if (null != page) { this.tabControl.SelectedTab = page; } else { this.tabControl.TabPages.Add(node.Id.ToString(), node.Text); page = this.tabControl.TabPages[node.Id.ToString()]; ContextMenuStrip cms = new ContextMenuStrip(); page.ContextMenuStrip = cms; page.AutoScroll = true; STPage panel = new STPage(node); panel.cqp = this.cqdo; panel.ControlSelectedEvent += new UIEditor.SationUIControl.STPage.ControlSelectedEventDelegate(this.STPage_ControlChangedEvent); //panel.ControlDeleteEvent += new UIEditor.SationUIControl.STPage.ControlDeleteEventDelegate(this.STPage_ControlDeleteEvent); panel.PageChangedEvent += new UIEditor.SationUIControl.STPage.PageChangedEventDelegate(this.STPage_PageChangedEvent); page.Controls.Add(panel); } page.Tag = node; this.tabControl.SelectedTab = page; this.curPageNode = node; this.curSTPage = node.panel as STPage; CheckTabControl(); }
private void ResetParameter() { this.curPageNode = null; this.curSelectedNode = null; if (null != this.curSTPage) { this.curSTPage.Parent.Controls.Remove(this.curSTPage); this.curSTPage = null; } //this.curSTPanel = null; //this.curFrameControl = null; MyCache.ResetVariable(); }
private void tabControl_Selected(object sender, TabControlEventArgs e) { TabPage page = e.TabPage; if (null != page) { PageNode node = page.Tag as PageNode; this.curSTPage = node.panel as STPage; SetSelectedNode(node); } }