public void stokKartiAc() { bool sart = false; for (int i = 0; i < xtratabana.TabPages.Count; i++) { if (xtratabana.TabPages[i].Text == "Stok Tanıtım Kartı") { xtratabana.SelectedTabPageIndex = i; sart = true; } } if (sart == false) { XtraTabPage pageadd = new XtraTabPage(); Panel paneladd = new Panel(); pageadd.Text = "Stok Kartı"; pageadd.Name = "stokKarti"; pageadd.Controls.Add(paneladd); paneladd.Dock = DockStyle.Fill; xtratabana.TabPages.Add(pageadd); xtratabana.SelectedTabPageIndex = xtratabana.TabPages.Count; paneladd.Controls.Clear(); StokModulu.frmStokTanitimKarti newForm = new StokModulu.frmStokTanitimKarti(); newForm.Height = xtratabana.Size.Height - 30; newForm.Width = xtratabana.Size.Width; newForm.TopLevel = false; paneladd.Controls.Add(newForm); newForm.Show(); newForm.Dock = DockStyle.Fill; newForm.BringToFront(); xtratabana.SelectedTabPage = pageadd; } }
private void xtratabana_CloseButtonClick(object sender, System.EventArgs e) { if (xtratabana.SelectedTabPage.Name == "Stok Kartı") { StokModulu.frmStokTanitimKarti frmStokTanitimKarti = new StokModulu.frmStokTanitimKarti(); Temizle(); } xtratabana.TabPages.RemoveAt(xtratabana.SelectedTabPageIndex); }