Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have 'Up' and 'Down' buttons that I want to use to be able to scroll through the items in a listbox.
When the currently selected item is at the top, the 'Up' button is disabled. I've done this by writing:If Listbox1.SelectedIndex = 0 Then
btnUp.Enabled = False
This works.
When the user has selected the last item in the listbox, the 'Down' button should disable. I have used the code:
If Listbox1.SelectedIndex = listIndex - 1 Then
btnDown.Enabled = False
End If
The button doesn't seem to disable.
I'm just looking for a few tips on how to be able to scroll through all of the listbox items and to get the Up and Down buttons to work properly.
I've used the method ListIndex but it tells me it isnt a member of:
Windows.System.Form.ListboxCan anybody give me a few pointers to help me?
Thanks

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |