ListView - On Key down event

Joined
Jan 25, 2006
Messages
1
Reaction score
0
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. :confused:

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.

 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top