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); } }
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; } } } }