private void btnAddLine_Click(object sender, EventArgs e)
        {
            NewLine      novalinija   = new NewLine();
            DialogResult dialogResult = novalinija.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                lbLines.Items.Add(novalinija.Line);
            }
        }
コード例 #2
0
 private void btnAddLine_Click(object sender, EventArgs e)
 {
     if (btnAddLine.Enabled)
     {
         NewLine      nl       = new NewLine();
         DialogResult response = nl.ShowDialog();
         if (lstBusses.SelectedIndex != -1)
         {
             Bus b = lstBusses.SelectedItem as Bus;
             if (response == DialogResult.OK)
             {
                 b.AddLine(nl.Line);
                 loadLines();
             }
         }
     }
 }