Total Pageviews

Thursday, September 15, 2016

Delete Selected Item from ListBox in Visual Basic 2015

To delete selected item from listbox you need to use the following code.

Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles Delete.Click
 Dim itemfordeletion
 itemfordeletion = ListBox1.SelectedItem
 ListBox1.Items.Remove(itemfordeletion)
End Sub

No comments:

Post a Comment