[Help]Removing item from listbox [solved]
i want to delete an item out of the list box when i click a button on that selected item so this is what i did but didnt work ..
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.Remove(ListBox1.SelectedItem)
End Sub
are you sure it selected? when you press the button?
Dim index as Integer = listbox1.SelectedIndex
if index <> -1 then
listbox1.items.removeat(index)
end if
listBox1.Items.Remove(listBox1.SelectedValue);
i think i cant remember havent used list box in ages :P
Thread marked solved. Bleh this section is in need of a firm scrubbing.