コード例 #1
0
 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);
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: freelandy/MHSSystem
        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();
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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;
                }
            }
        }
コード例 #5
0
ファイル: Studio.cs プロジェクト: thachgiasoft/abc-erp
        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 );
            }
        }
コード例 #6
0
ファイル: RibbonForm1.cs プロジェクト: qwdingyu/C-
        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;
                }
            }
        }
コード例 #7
0
        /// <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;
                }
            }
        }
コード例 #8
0
 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);
     }
 }
コード例 #9
0
ファイル: MainForm.cs プロジェクト: wangshuai-007/007_wms
        /// <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;
                }
            }
        }
コード例 #10
0
ファイル: StartForm.cs プロジェクト: hellpierrot/CETAging
        /// <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();
        }
コード例 #11
0
ファイル: MainRibbonForm.cs プロジェクト: qwdingyu/C-
        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;
                }
            }
        }
コード例 #12
0
        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);
            }
        }
コード例 #13
0
        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;
                }
            }
        }
コード例 #14
0
ファイル: XDFS.cs プロジェクト: XDFS-201314/XDFS
 private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e)
 {
     DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs eArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e;
     RemoveControlToPage(eArg.Page.Text, xtraTabControl1);
 }
コード例 #15
0
ファイル: frmMain.cs プロジェクト: thachgiasoft/qlkho-dongluc
 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();
 }
コード例 #16
0
ファイル: MainForm.cs プロジェクト: radtek/YY
 //模块关闭事件
 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);
 }
コード例 #17
0
ファイル: MainForm.cs プロジェクト: hubeizys/SgProduceManager
 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);
 }
コード例 #18
0
 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);
 }
コード例 #19
0
 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;
 }