Hello all,


I have a list box and I want to delete an item by pressing 'delete'

My code only works with backspace... What can I do?

VB Code:
  1. Private Sub lst1_KeyPress(KeyAscii As Integer)
  2.     If lst1.ListCount > 0 Then
  3.         If KeyAscii = 8 Then
  4.             lst1.RemoveItem lst1.ListIndex
  5.         End If
  6.     End If
  7. End Sub

I supose that ascii code for delete key is 127... but if you press 'delete', the event lst1_KeyPress don't catch it...

Thanks