private void CloseCanva_Click(object sender, EventArgs e)
        {
            if ((ActiveMdiChild as Canvas).Saved == false)
            {
                DialogResult result = MessageBox.Show($"Вы хотите сохранить изменения в файле {(ActiveMdiChild as Canvas).Name}?",
                                                      "My Paint", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

                if (result == DialogResult.OK)
                {
                    var m_SaveFileDialog = new SaveFileDialog();
                    m_SaveFileDialog.Filter           = @"*.bmp|*.bmp|*.jpg|*.jpg|*.png|*.png|*.gif|*.gif";
                    m_SaveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
                    if (m_SaveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        string filename = m_SaveFileDialog.FileName;

                        if ((ActiveMdiChild as Canvas).curimage != null)
                        {
                            (ActiveMdiChild as Canvas).curimage.Save(filename);
                            (ActiveMdiChild as Canvas).Saved = true;
                        }

                        filenames[ActiveMdiChild.Name] = filename;
                    }

                    for (int i = 0; i < WindowsButton.DropDownItems.Count; i++)
                    {
                        if (WindowsButton.DropDownItems[i].Name == ActiveMdiChild.Name)
                        {
                            WindowsButton.DropDownItems[i].Dispose();
                        }
                    }
                    if (filenames.ContainsKey(ActiveMdiChild.Name))
                    {
                        filenames.Remove(ActiveMdiChild.Name);
                    }
                    ActiveMdiChild.Close();
                }
            }
            else
            {
                for (int i = 0; i < WindowsButton.DropDownItems.Count; i++)
                {
                    if (WindowsButton.DropDownItems[i].Name == ActiveMdiChild.Name)
                    {
                        WindowsButton.DropDownItems[i].Dispose();
                    }
                }
                if (filenames.ContainsKey(ActiveMdiChild.Name))
                {
                    filenames.Remove(ActiveMdiChild.Name);
                }
                ActiveMdiChild.Close();
            }
        }
Exemple #2
0
        private void searchBooksToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmSearchBooks searchBooks = new frmSearchBooks();

            searchBooks.Show();
            searchBooks.MdiParent = this;
        }
Exemple #3
0
        private void profileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            UserRegistration UserRegistration = new UserRegistration();

            UserRegistration.MdiParent = this;
            UserRegistration.Show();
        }
Exemple #4
0
        private void patientToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            PrescriptionDetails PrescriptionDetails = new PrescriptionDetails();

            PrescriptionDetails.MdiParent = this;
            PrescriptionDetails.Show();
        }
Exemple #5
0
        private void addLabTestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            AddLabTests AddLabTests = new AddLabTests();

            AddLabTests.MdiParent = this;
            AddLabTests.Show();
        }
Exemple #6
0
        private void btnKlijenti_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmKlijenti frmKlijent = new frmKlijenti();

            frmKlijent.MdiParent = this;
            frmKlijent.Show();
        }
Exemple #7
0
        private void btnRacuni_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmRacuni frmRacuni = new frmRacuni();

            frmRacuni.MdiParent = frmRacuni.ActiveForm;
            frmRacuni.Show();
        }
Exemple #8
0
        private void btnPregledRezervacije_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmPregledRezervacija frmPregledRez = new frmPregledRezervacija();

            frmPregledRez.MdiParent = frmPregledRezervacija.ActiveForm;
            frmPregledRez.Show();
        }
 private void mnuFileClose_Click(object sender, EventArgs e)
 {
     try
     {
         ActiveMdiChild.Close();
     }
     catch (NullReferenceException nre)
     {
         MessageBox.Show("No forms to close", "Close Error");
     }
 }
Exemple #10
0
        private void btnIzaberiArtikle_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmNarudzbaArtikli frmNazArtikli = new frmNarudzbaArtikli();

            frmNazArtikli.MdiParent = frmNarudzbaArtikli.ActiveForm;
            frmNazArtikli.Show();
        }
Exemple #11
0
 private void MenuThoat_Click(object sender, EventArgs e)
 {
     if (ActiveMdiChild == null)
     {
         Close();
     }
     while (ActiveMdiChild != null)
     {
         ActiveMdiChild.Close();
     }
 }
Exemple #12
0
        private void returnBookToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmBookReturn bookReturn = new frmBookReturn();

            bookReturn.Show();
            bookReturn.MdiParent = this;
        }
Exemple #13
0
        private void viewBookIssueToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmViewIBookIssue bookIssue = new frmViewIBookIssue();

            bookIssue.Show();
            bookIssue.MdiParent = this;
        }
Exemple #14
0
        private void borrowBookToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmBorrowBook borrowBook = new frmBorrowBook();

            borrowBook.Show();
            borrowBook.MdiParent = this;
        }
Exemple #15
0
        private void hesapKApatToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            FrmHesapKapatma y = new FrmHesapKapatma(BankApp);

            y.MdiParent = this;
            y.Show();
        }
        private void btnPovratak_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmKlijenti frmKlijent = new frmKlijenti();

            frmKlijent.MdiParent = frmKlijenti.ActiveForm;
            frmKlijent.Show();
        }
Exemple #17
0
 private void zatvoriToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (ActiveMdiChild == null)
     {
         this.Close();
     }
     else
     {
         ActiveMdiChild.Close();
     }
 }
        private void btnPovratak_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmDobavljaci frmDobavljac = new frmDobavljaci();

            frmDobavljac.MdiParent = frmDobavljaci.ActiveForm;
            this.Close();
        }
Exemple #19
0
        private void btnProdaja_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmProdaja frmProdaja = new frmProdaja();

            frmProdaja.MdiParent = frmProdaja.ActiveForm;
            frmProdaja.Show();
        }
Exemple #20
0
        private void hesapÖzetiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            FrmHesapOzeti y = new FrmHesapOzeti(BankApp);

            y.MdiParent = this;
            y.Show();
        }
Exemple #21
0
        private void btnArtikli_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmPregledArtikla openPregledArtikla = new frmPregledArtikla();

            openPregledArtikla.MdiParent = this;
            openPregledArtikla.Show();
        }
Exemple #22
0
        private void paraÇekYatırToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            FrmParaYatirmaVeCekme y = new FrmParaYatirmaVeCekme(BankApp);

            y.MdiParent = this;
            y.Show();
        }
Exemple #23
0
        private void btnNarudzba_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmPregledNarudzbenica frmPregledNar = new frmPregledNarudzbenica();

            frmPregledNar.MdiParent = this;
            frmPregledNar.Show();
        }
Exemple #24
0
        private void havaleGönderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            FrmHavale y = new FrmHavale(BankApp);

            y.MdiParent = this;
            y.Show();
        }
Exemple #25
0
        private void addDrugsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            DrugInfo Druginfo = new DrugInfo();

            Druginfo.MdiParent = this;
            Druginfo.Show();
        }
Exemple #26
0
        private void gelirGiderListesiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            FrmBankaGelirGider y = new FrmBankaGelirGider(BankApp);

            y.MdiParent = this;
            y.Show();
        }
Exemple #27
0
        private void ptientInfoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            PatientInfoReport PatientInfoReport = new PatientInfoReport();

            PatientInfoReport.MdiParent = this;
            PatientInfoReport.Show();
        }
Exemple #28
0
        private void müşteriBilgileriToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            MusteriBilgi y = new MusteriBilgi(BankApp);

            y.MdiParent = this;
            y.Show();
        }
 private void menuItemClose_Click(object sender, System.EventArgs e)
 {
     if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
     {
         ActiveMdiChild.Close();
     }
     else if (dockPanel.ActiveDocument != null)
     {
         dockPanel.ActiveDocument.DockHandler.Close();
     }
 }
Exemple #30
0
        private void btnDodaj_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild != null)
            {
                ActiveMdiChild.Close();
            }
            frmDodajDobavljaca frmDodaj = new frmDodajDobavljaca();

            frmDodaj.MdiParent = frmDodajDobavljaca.ActiveForm;
            frmDodaj.Show();
        }