GingerCode
New member
- Joined
- Aug 14, 2014
- Messages
- 4
- Programming Experience
- Beginner
Hello, I have a listbox that I am trying to delete a selected item when I press the delete key. I have tried this on key down and key press, with no luck.
Any advice would be greatly appreciated.
Thank you
Private Sub lbTicketBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles lbTicketBox.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Delete) Then
lbTicketBox.Items.RemoveAt(lbTicketBox.SelectedIndex)
End If
End Sub
Any advice would be greatly appreciated.
Thank you
Private Sub lbTicketBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles lbTicketBox.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Delete) Then
lbTicketBox.Items.RemoveAt(lbTicketBox.SelectedIndex)
End If
End Sub