c# - how can i get the value of index in listbox? -


i writing c# windows form application program on vb. have listbox , when double-click on data removed before delete want keep data in string or integer. how can that?
here code delete:

void listbox1_mousedoubleclick(object sender, mouseeventargs e) {     int index = this.listbox1.indexfrompoint(e.location);      if (index != system.windows.forms.listbox.nomatches)     {         messagebox.show(index.tostring());          listbox1.items.removeat(index);                   } } 

you can store selected item in variable this

object selected = listbox1.items[index]; 

is you're asking for?


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -