list box scroll wraparound

rwwilliamson

New User
Local time
Today, 01:32
Joined
May 26, 2005
Messages
11
Simple wish to wrap to the top record in list box when bottom is reached. I stumbled across a thread for this solution once, but failed to book mark it. I have searched in vain but I know it already exists!
 
There's not a built-in way to do that. The easiest way would be to make custom navigation buttons ("Go First" and "Go Last", for example, or equivalent graphics). The programming behind the buttons is very simple:

Code:
Sub GoFirst_Click()

    YourListboxName = YourListboxName.ItemData(1)

End Sub

Sub GoLast_Click()

    YourListboxName = YourListboxName.ItemData((YourListboxName.ListCount)-1)

End Sub
 
Thanks Moniker, but that's not exactly what I need. I recall the code is an Event Procedure that's tied to "OnClick" for the list box. If scroll command is down, test for last record, if true, then jump to first, else continue. If command is up, test for first record, if true jump to last else continue. Maybe I should stop being lazy and puzzle it out myself.
 

Users who are viewing this thread

Back
Top Bottom