void OnMouseDoubleClick(object sender, MouseEventArgs e) { var list = (ListBox)sender; int itemIndex = list.IndexFromPoint(e.Location); if (itemIndex != -1) { object item = list.Items[itemIndex]; } }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { int ndx = (sender as ListBox).SelectedIndex; // check for no selection if (ndx == -1) return; switch (ndx) { case 0: // create whatever // show whatever break; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)