Enter key ..in Listview

V

Vinay

Hi,
I want to capture "Enter key" event in Listview .Basically if user presses
Enter key after selecting any item from listview I want to capture it.
Plz suggest me how to capture keystrokes for Listview control.


regds
vinay
 
A

Andy Pope

Hi vinay,

Try this code.

Private Sub ListView1_KeyDown(KeyCode As Integer, _
ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then
MsgBox ListView1.SelectedItem.Text
End If
End Sub

Cheers
Andy
 

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