G
gv
Hi all,
Using VB 2005 Express
When pressing the down key in a listbox and getting to the last item I want
to
move right back to the top and vise versa so it never stops when pressing
the
arrow keys. The code below moves it when it gets to the end of the list biut
skips the first item
and moves to index 1.
Private Sub ListBox1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown
If ListBox1.SelectedIndex = (ListBox1.Items.Count - 1) And e.KeyCode =
Keys.Down Then
ListBox1.SetSelected(0, True)
End If
End Sub
thanks
Gerry
Using VB 2005 Express
When pressing the down key in a listbox and getting to the last item I want
to
move right back to the top and vise versa so it never stops when pressing
the
arrow keys. The code below moves it when it gets to the end of the list biut
skips the first item
and moves to index 1.
Private Sub ListBox1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown
If ListBox1.SelectedIndex = (ListBox1.Items.Count - 1) And e.KeyCode =
Keys.Down Then
ListBox1.SetSelected(0, True)
End If
End Sub
thanks
Gerry