private void RoutesBoxList_MouseDoubleClick(object sender, MouseEventArgs e) { int index = this.RoutesBoxList.IndexFromPoint(e.Location); if (index != System.Windows.Forms.ListBox.NoMatches) { if (RoutesBoxList.SelectedItem != null) { try { int a = RoutesBoxList.SelectedIndex; Route r = rts.getRoutebyId(a); Edit edit = new Edit(rts, a, r.getLevel(), r.getExpand(), r.getLeaf(), r.getCateg(), r.getId(), r.getParentId(), r.getFtWeight(), r.getFtWeight2(), r.getFtWeight3(), r.getFtWeight4(), r.getFtWeight5(), r.getFtWeight6(), r.getFtWeight7(), r.getMap(), r.getDetails()); edit.ShowDialog(); } catch (Exception b) { MessageBox.Show(b.ToString()); } } } }
private void button3_Click(object sender, EventArgs e) { if (RoutesBoxList.SelectedItem != null) { try { int a = RoutesBoxList.SelectedIndex; Route r = rts.getRoutebyId(a); Edit edit = new Edit(rts, a, r.getLevel(), r.getExpand(), r.getLeaf(), r.getCateg(), r.getId(), r.getParentId(), r.getFtWeight(), r.getFtWeight2(), r.getFtWeight3(), r.getFtWeight4(), r.getFtWeight5(), r.getFtWeight6(), r.getFtWeight7(), r.getMap(), r.getDetails()); edit.ShowDialog(); } catch (Exception b) { MessageBox.Show(b.ToString()); } } else { MessageBox.Show("Nothing Selected", "Error"); } }