Exemplo n.º 1
0
        private void xtraTabControl1_CloseButtonClick_1(object sender, EventArgs e)
        {
            //ClosePageButtonEventArgs a = (ClosePageButtonEventArgs)e;
            //string tabpagename = a.Page.Text;
            //foreach (Control xtp in xtraTabControl1.TabPages)
            //{
            //    if (xtp.Text == tabpagename)
            //    {
            //        xtp.Dispose();
            //        return;
            //    }
            //}

            creatForm.RemoveTabPage(xtraTabControl1, e);

            //#region
            //DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs a = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e;
            //string tabpagename = a.Page.Text;
            //foreach (XtraTabPage xtp in xtraTabControl1.TabPages)
            //{
            //    //if (xtp.ShowCloseButton.Equals(DevExpress.Utils.DefaultBoolean.True))
            //    //{
            //    if (xtp.Text == tabpagename)
            //    {
            //        DevExpress.XtraEditors.XtraForm form = xtp.Controls[0] as DevExpress.XtraEditors.XtraForm;
            //        form.Close();
            //        form.Dispose();
            //        xtraTabControl1.TabPages.Remove((a.Page as XtraTabPage));
            //        xtp.Dispose();
            //        return;
            //    }
            //    //}
            //}
            //#endregion
        }