コード例 #1
0
ファイル: Bank_Report.cs プロジェクト: ayaRayan93/TaxesSystem
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (MainTabPageAddBank.ImageOptions.Image == null)
                {
                    MainTabPageAddBank.Name = "tabPageAddBank";
                    MainTabPageAddBank.Text = "اضافة بنك";
                    MainTabPageAddBank.ImageOptions.Image = null;
                    panelAddBank.Name = "panelAddBank";
                    panelAddBank.Dock = DockStyle.Fill;

                    panelAddBank.Controls.Clear();

                    Bank_All form = new Bank_All();
                    form.Size            = new Size(1059, 638);
                    form.TopLevel        = false;
                    form.FormBorderStyle = FormBorderStyle.None;
                    form.Dock            = DockStyle.Fill;
                    panelAddBank.Controls.Add(form);
                    MainTabPageAddBank.Controls.Add(panelAddBank);
                    MainTabControlBank.TabPages.Add(MainTabPageAddBank);
                    form.Show();
                    MainTabControlBank.SelectedTabPage = MainTabPageAddBank;
                }
                else
                {
                    if (MessageBox.Show("هناك تعديلات لم تحفظ بعد..هل انت متاكد انك تريد التجاهل؟", "تحذير", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes)
                    {
                        MainTabControlBank.SelectedTabPage = MainTabPageAddBank;
                        return;
                    }
                    else
                    {
                        panelAddBank.Controls.Clear();
                        MainTabPageAddBank.ImageOptions.Image = null;
                        Bank_Record form = new Bank_Record();
                        form.Size            = new Size(1059, 638);
                        form.TopLevel        = false;
                        form.FormBorderStyle = FormBorderStyle.None;
                        form.Dock            = DockStyle.Fill;
                        panelAddBank.Controls.Add(form);
                        form.Show();

                        MainTabControlBank.SelectedTabPage = MainTabPageAddBank;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
ファイル: Bank_All.cs プロジェクト: ayaRayan93/TaxesSystem
        private void btnBank_Click(object sender, EventArgs e)
        {
            try
            {
                panelBankReport.Name = "panelBankReport";
                panelBankReport.Dock = DockStyle.Fill;

                BankReport                 = new Bank_Record();
                BankReport.Size            = new Size(1109, 660);
                BankReport.TopLevel        = false;
                BankReport.FormBorderStyle = FormBorderStyle.None;
                BankReport.Dock            = DockStyle.Fill;

                panelBankReport.Controls.Clear();
                panelBankReport.Controls.Add(BankReport);
                xtraTabPageBank.Controls.Add(panelBankReport);
                BankReport.Show();
                xtraTabControl1.SelectedTabPage = xtraTabPageBank;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }