コード例 #1
0
ファイル: Form1.cs プロジェクト: KuzuryuYaichi/HJ_2ATest
 private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         string      pageName = barButtonItem4.Caption;
         XtraTabPage page     = null;
         bool        flag     = IsTabControlExistPage(pageName, out page);
         if (flag)
         {
             page.PageVisible = true;
             page.Show();
         }
         else
         {
             page      = new XtraTabPage(); //新建一个标签页
             page.Text = pageName;
             page.Show();
             mACARS_Test      = new ACARS_Test();
             mACARS_Test.Dock = DockStyle.Fill;
             AddPage(xtraTabControl1, pageName, mACARS_Test);
         }
     }
     catch (System.Exception ex)
     {
     }
 }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: Arkadhan/PcZimmet
        public void SayfaAc(Type sayfaTuru, string text)
        {
            XtraTabPage eskiSayfa = SayfaBul(sayfaTuru);

            if (eskiSayfa != null)
            {
                eskiSayfa.Show();
                return;
            }

            UserControl form = (UserControl)Activator.CreateInstance(sayfaTuru) as UserControl;

            XtraTabPage sayfa = new XtraTabPage();

            sayfa.Text = text;
            sayfa.Controls.Add(form);
            form.Dock = DockStyle.Fill;
            xtraTabControl1.TabPages.Add(sayfa);
            xtraTabControl1.SelectedTabPage = sayfa;
        }