示例#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
        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);
                }
            }
        }