예제 #1
0
파일: Form1.cs 프로젝트: AtanasK/VP
 private void button1_Click(object sender, EventArgs e)
 {
     NewAirport newAirport = new NewAirport();
     if (newAirport.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         lbAirports.Items.Add(newAirport.Airport);
     }
 }
        private void btnAddAirport_Click(object sender, EventArgs e)
        {
            NewAirport newAirport = new NewAirport();

            if (newAirport.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                lbAirports.Items.Add(newAirport.Airport);
            }
        }
예제 #3
0
파일: Airports.cs 프로젝트: brsjak/VP-2015
        private void btnAddAirport_Click(object sender, EventArgs e)
        {
            NewAirport   na  = new NewAirport();
            DialogResult res = na.ShowDialog();

            if (res == DialogResult.OK)
            {
                if (containsAirport(na.Airport))
                {
                    MessageBox.Show("Тој аеродром веќе го има!", "Грешка!", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    lstAirports.Items.Add(na.Airport);
                }
            }
        }