private void distancesToolStripMenuItem_Click(object sender, EventArgs e) { List <string> l = new List <string>(); foreach (var item in listBox1.Items) { l.Add((string)item); } DistanceSave sa; if (l.Count > 0) { sa = new DistanceSave(l[0]); } else { sa = new DistanceSave(); } sa.ShowDialog(); }
private void distancesToolStripMenuItem_Click(object sender, EventArgs e) { List<string> l = new List<string>(); foreach (var item in listBox1.Items) { l.Add((string)item); } DistanceSave sa; if (l.Count > 0) sa = new DistanceSave(l[0]); else sa= new DistanceSave(); sa.ShowDialog(); }