vb.net - Delete Item from ListBox and Update Total Visual Basic -
i new in vb, have managed add items in listbox , update total keep on adding items. question want delete selected items listbox , update total/deduct price, don't know how it. posting sample code used add total. private sub btncoffee6_click(sender object, e eventargs) handles btncoffee6.click dim sum double sum = 1.5 itembox.items.add("regular coffee $1.00") x integer = 0 itembox.items.count - 1 sum += val(itembox.items.item(x).tostring) next txttotal.text = sum.tostring itembox.items.add(sum) end sub try removeat() , yes tutorial dim sum double private sub btnremove_click(sender object, e eventargs) handles btnremove.click itembox.items.removeat(itembox.selectedindex) sum = sum - val(itembox.items.item(itembox.selectedindex).tostring) txttotal.text = sum.tostring itembox.items.add(sum) end sub