示例#1
0
文件: Form1.cs 项目: AtanasK/VP
 private void button1_Click(object sender, EventArgs e)
 {
     NewBus newBus = new NewBus();
     if (newBus.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         lbBussues.Items.Add(newBus.Bus);
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            NewBus newBus = new NewBus();

            if (newBus.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                lbBussues.Items.Add(newBus.Bus);
            }
        }
        private void btnAddBus_Click(object sender, EventArgs e)
        {
            NewBus       novbus       = new NewBus();
            DialogResult dialogResult = novbus.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                lbBus.Items.Add(novbus.bus);
            }
        }
示例#4
0
 private void btnAddBus_Click(object sender, EventArgs e)
 {
     if (btnAddBus.Enabled)
     {
         NewBus       nb       = new NewBus();
         DialogResult response = nb.ShowDialog();
         if (response == DialogResult.OK)
         {
             if (!containsBus(nb.Bus))
             {
                 lstBusses.Items.Add(nb.Bus);
                 loadLines();
             }
             else
             {
                 MessageBox.Show("Автобус со таа регистарска таблица веќе постои!", "Грешка!",
                                 MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
             }
         }
     }
 }