private void btnAdd_Click(object sender, EventArgs e) { try { if (BankPullExpense_Record.addBankPullExpenseTextChangedFlag == false) { MainTabPageRecordPullExpense.Name = "tabPageRecordPullExpense"; MainTabPageRecordPullExpense.Text = "اضافة مصروف"; MainTabPageRecordPullExpense.ImageOptions.Image = null; panelRecordPullExpense.Name = "panelRecordPullExpense"; panelRecordPullExpense.Dock = DockStyle.Fill; panelRecordPullExpense.Controls.Clear(); BankPullExpense_Record form = new BankPullExpense_Record(); form.Size = new Size(1059, 638); form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.Dock = DockStyle.Fill; panelRecordPullExpense.Controls.Add(form); MainTabPageRecordPullExpense.Controls.Add(panelRecordPullExpense); MainTabControlBank.TabPages.Add(MainTabPageRecordPullExpense); form.Show(); MainTabControlBank.SelectedTabPage = MainTabPageRecordPullExpense; } else { if (MessageBox.Show("هناك تعديلات لم تحفظ بعد..هل انت متاكد انك تريد التجاهل؟", "تحذير", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) { MainTabControlBank.SelectedTabPage = MainTabPageRecordPullExpense; return; } else { panelRecordPullExpense.Controls.Clear(); MainTabPageRecordPullExpense.ImageOptions.Image = null; BankPullExpense_Record form = new BankPullExpense_Record(); form.Size = new Size(1059, 638); form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.Dock = DockStyle.Fill; panelRecordPullExpense.Controls.Add(form); form.Show(); MainTabControlBank.SelectedTabPage = MainTabPageRecordPullExpense; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void bindRecordPullExpenseForm(BankPullExpense_Report form) { BankPullExpense_Record objForm = new BankPullExpense_Record(form, MainTabControlBank); objForm.TopLevel = false; XtraTabPage xtraTabPage = getTabPage(MainTabControlBank, "اضافة مرتد-مصروف"); if (xtraTabPage == null) { MainTabControlBank.TabPages.Add("اضافة مرتد-مصروف"); xtraTabPage = getTabPage(MainTabControlBank, "اضافة مرتد-مصروف"); xtraTabPage.Controls.Clear(); xtraTabPage.Controls.Add(objForm); } MainTabControlBank.SelectedTabPage = xtraTabPage; objForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; objForm.Dock = DockStyle.Fill; objForm.Show(); }