void Script_CloseButtonClick(object sender, EventArgs e) { if (e is DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs ex = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; ScriptTabControl.TabPages.Remove((DevExpress.XtraTab.XtraTabPage)ex.Page); } }
private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs arg = e as DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs; DevExpress.XtraTab.XtraTabPage page = arg.Page as DevExpress.XtraTab.XtraTabPage; page.Controls.Clear(); this.xtraTabControl1.TabPages.Remove(page); page.Dispose(); }
private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs arg = e as DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs; DevExpress.XtraTab.XtraTabPage page = (arg.Page as DevExpress.XtraTab.XtraTabPage); UserControl uc = new UserControl(); foreach (UserControl item in page.Controls) { uc = item; } DongUC(uc, page.Name); DongXtabPage(page.Name); }
private void tcMain_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; string name = EArg.Page.Text; //得到关闭的选项卡的text foreach (XtraTabPage page in tcMain.TabPages) //遍历得到和关闭的选项卡一样的Text { if (page.Text == name) { tcMain.TabPages.Remove(page); return; } } }
void TabViewControl_CloseButtonClick(object sender, EventArgs e) { if (e is DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs ee = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; HostControl hostCtrl = ((DevExpress.XtraTab.XtraTabPage)ee.Page).Tag as HostControl; if (hostCtrl.HostSurface != null) { Worker.CloseSurface(hostCtrl.HostSurface); } //if ( this.TabViewControl.TabPages.Contains( (DevExpress.XtraTab.XtraTabPage)ee.Page ) ) // this.TabViewControl.TabPages.Remove( (DevExpress.XtraTab.XtraTabPage)ee.Page ); } }
void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; string name = EArg.Page.Text; foreach (XtraTabPage page in this.xtraTabControl1.TabPages)//遍历得到和关闭的选项卡一样的Text { if (page.Text == name) { this.xtraTabControl1.TabPages.Remove(page); page.Dispose(); return; } } }
/// <summary> /// 移除选项卡页 /// </summary> /// <param name="tabControl"></param> /// <param name="tabPageName"></param> /// <param name="e"></param> public void RemoveTabPage(XtraTabControl tabControl, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs args = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; string name = args.Page.Tooltip; foreach (XtraTabPage item in tabControl.TabPages) { if (item.Name == name) { tabControl.TabPages.Remove(item); item.Dispose(); TabPageDic.Remove(name); return; } } }
private void xtraTabControl_Home_CloseButtonClick(object sender, EventArgs e) { try { XtraTabControl xtab = (XtraTabControl)sender; int i = xtab.SelectedTabPageIndex; DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs arg = e as DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs; xtab.TabPages.Remove((arg.Page as XtraTabPage)); xtab.SelectedTabPageIndex = i - 1; System.GC.Collect(); } catch (Exception ex) { O2S_Common.Logging.LogSystem.Error(ex); } }
/// <summary> /// 关闭选项卡方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; string name = EArg.Page.Text;//得到关闭选项卡的text //遍历选项卡,找到要关闭的(text)选项卡,并关闭 foreach (XtraTabPage item in xtraTabControl1.TabPages) { if (item.Text == name) { xtraTabControl1.TabPages.Remove(item); item.Dispose(); return; } } }
/// <summary> /// 탭 페이지 삭제 이벤트 /// </summary> private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { // Config 탭은 삭제하지 않음 if (xtraTabControl1.SelectedTabPage == xtpConfig) { return; } DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs arg = e as DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs; XtraTabPage xtraTabPage = arg.PrevPage as XtraTabPage; if (xtraTabPage == null) { return; } xtraTabControl1.TabPages.Remove(xtraTabPage); xtraTabPage.Dispose(); }
void tabPageControl_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; IXtraTabPage closingPage = EArg.Page; foreach (XtraTabPage page in this.tabPageControl.TabPages)//遍历得到和关闭的选项卡一样的Text { if (closingPage == page) { this.tabPageControl.TabPages.Remove(page); page.Dispose(); int count = this.tabPageControl.TabPages.Count; if (count > 0) { this.tabPageControl.SelectedTabPageIndex = count - 1; } return; } } }
private void TabControl_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; string tag = (EArg.Page as XtraTabPage).Tag.ToString(); //得到关闭的选项卡的text foreach (XtraTabPage page in TabControl.TabPages) //遍历得到和关闭的选项卡一样的Text { if (page.Tag.Equals(tag)) { TabControl.TabPages.Remove(page); page.Dispose(); break; } } if (TabControl.TabPages.Count == 0 && TabPageCleanedEvent != null) { TabPageCleanedEvent.Invoke(TabControl); } }
void CJiaTabControl_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; string tbpName = EArg.Page.Text; string tbpSelectName = this.SelectedTabPage.Text; foreach (DevExpress.XtraTab.XtraTabPage xtp in this.TabPages) { if (xtp.Text == tbpName) { if (tbpName == tbpSelectName) { int index = this.SelectedTabPageIndex; this.SelectedTabPageIndex = index - 1; } this.TabPages.Remove(xtp); xtp.Dispose(); return; } } }
private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs eArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; RemoveControlToPage(eArg.Page.Text, xtraTabControl1); }
private void tabControl_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.XtraTabControl tabControl = sender as DevExpress.XtraTab.XtraTabControl; DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs arg = e as DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs; (arg.Page as DevExpress.XtraTab.XtraTabPage).Dispose(); }
//模块关闭事件 private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs c = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; DevExpress.XtraTab.XtraTabPage page = (DevExpress.XtraTab.XtraTabPage)c.PrevPage; this.xtraTabControl1.TabPages.Remove(page); }
private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; Console.WriteLine(this.xtraTabControl1.ShowHeaderFocus.ToString()); this.xtraTabControl1.TabPages.RemoveAt(this.xtraTabControl1.SelectedTabPageIndex); }
private void xtraTabControl_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e; AccordionControlUtil.Instance.CloseTabpageByTitle(EArg.Page.Text, xtraTabControl); }
private void tabs_CloseButtonClick(object sender, EventArgs e) { DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs arg = e as DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs; (arg.Page as DevExpress.XtraTab.XtraTabPage).PageVisible = false; }