//关闭最后一个隐藏面板 private void superTabControl1_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { Console.WriteLine("关闭item操作" + superTabControl1.Tabs.Count); if (superTabControl1.Tabs.Count == 1) { superTabControl1.Visible = false; } }
private void lendingTab_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { if (e.Tab.Text == "New") { e.Cancel = true; } //TODO : if the tab is not saved then cancel else don't }
private void superTabControlX_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { if (superTabControlX.Tabs.Count <= 1) { e.Cancel = true; OpenUrl(null); } }
/// <summary> /// 选项卡关闭事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void superTabControl_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { IEnumerable <Form> forms = (e.Tab as SuperTabItem).AttachedControl.Controls.OfType <Form>(); foreach (Form form in forms) { form.Close(); } }
/// <summary> /// 选项卡关闭事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NavTabControl1_TabItemClose_1(object sender, SuperTabStripTabItemCloseEventArgs e) { foreach (SuperTabItem item in NavTabControl1.Tabs) { if (item.Name == "运行操作") { SerialPortHelper.SerialPortHelper.comPort.Close(); SerialPortHelper.SerialPortHelper.comPort.Dispose(); } } }
private void stcMain_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { var key = e.Tab.Name; var form = _pluginManager.FindPluginMainForm(key); var mergeable = form as IMergable; if (mergeable != null) { mergeable.Unmerge(); } _pluginManager.RemovePluginMainForm(key); }
private void superTabControl1_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { string selectedTab = e.Tab.Text;//获取当前TabItem的显示文本 string controlName = null; tablItemDit.TryGetValue(selectedTab, out controlName); //获取当前TabItem中内嵌的Form的Name属性值 Form frm = this.superTabControl1.Controls.Find(controlName, true)[0] as Form; //获取内嵌的Form对象 frm.Close(); //调用form的close事件,即触发了内嵌窗体的关闭事件 }
/// <summary> /// 点击TabControl的关闭按钮时,首页和项目信息两个TAB不关闭,其它正常 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void superTabControl1_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { if (e.Tab.Name == "StartPage") { e.Cancel = true; } if (e.Tab.Name == "NormalOperation") { nodePage = null; } if (e.Tab.Name == "Routine") { nodeRoutine = null; } if (e.Tab.Name == "Trouble") { nodeTrouble = null; } }
private void superTabControl1_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { if (e.Tab.Text == "首页") { e.Cancel = true; ToastNotification.ToastBackColor = Color.Red; ToastNotification.ToastForeColor = Color.White; ToastNotification.ToastFont = new Font("微软雅黑", 15); ToastNotification.Show(superTabControl1, "默认页不允许关闭", null, 3000, eToastGlowColor.Red, eToastPosition.TopCenter); } if (pairs.ContainsKey(e.Tab.Text)) { pairs.Remove(e.Tab.Text); } if (pairs.Count == 0) { buttonItem19.Enabled = false; } }
private void superTabControl1_TabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { //ClosePage(superTabControl1.Tabs.IndexOf(e.Tab)); ((e.Tab as SuperTabItem).AttachedControl.Controls[0] as WebPage).Close(); }
/// <summary> /// Handles TabItemClose events /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void TabStripTabItemClose(object sender, SuperTabStripTabItemCloseEventArgs e) { if (TabItemClose != null) TabItemClose(this, e); }