I am trying to capture the keydown event on a listbox but it doesnt appear to be working...
Is there a known problem with capturing the keydown event on a listview?
The listview definitely has focus as I can use the arrow keys on my handheld to scroll through the records. But when I press the enter key nothing happens.
My code is as follows ( I want a button click event to be called if the user selects the enter key)...
PrivateSub lstHistory_KeyDown(ByVal sender AsObject, ByVal e As System.Windows.Forms.KeyEventArgs) Handles lstHistory.KeyDown
If e.KeyCode = Keys.Enter Then
Dim args AsNew System.EventArgs
btnHistory_Click(Me, args)
EndIf
EndSub
Cheers in advance,
X.
Is there a known problem with capturing the keydown event on a listview?
The listview definitely has focus as I can use the arrow keys on my handheld to scroll through the records. But when I press the enter key nothing happens.

My code is as follows ( I want a button click event to be called if the user selects the enter key)...
PrivateSub lstHistory_KeyDown(ByVal sender AsObject, ByVal e As System.Windows.Forms.KeyEventArgs) Handles lstHistory.KeyDown
If e.KeyCode = Keys.Enter Then
Dim args AsNew System.EventArgs
btnHistory_Click(Me, args)
EndIf
EndSub
Cheers in advance,
X.