Not quite clear on your question.
Are you using the KeyUp/KeyDown Events for the ListView or are you referring to the Up/Down arrow keys on your keyboard?
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
Now which ListView isNot responding properly? ListGroup or ListProduct?
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
"keydown" on which ListView?
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
See if this helps.
Private Sub _ListProduct_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListProduct.KeyDown
With CType(sender, ListView)
If Not .Items.Count = 0 Then
.MultiSelect = False
e.Handled = True '// block default handling.
Select Case e.KeyCode
Case Keys.Up
.Items(0).Selected = True '// select first item.
Case Keys.Down
.Items(.Items.Count - 1).Selected = True '// select last item.
End Select
.SelectedItems(0).EnsureVisible() '// make sure that item is visible once selected.
.HideSelection = False '// keep cute highlight on item.
End If
End With
End Sub
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
keydown listview2 not go to row 21
but go to row 1, also keyUp not go to row 19 but go to row 1
any one can help, what to do
Is there still an issue?
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384