scroll to top of a multi select listbox

spinkung

Registered User.
Local time
Today, 06:40
Joined
Dec 4, 2006
Messages
267
hi

i have a list box (extended) which i select all items using a button. after the selection the list box is scrolled to the bottom. i want the list box to scroll back to the top.

i've seen...

mylist.TopIndex=0 - which doesn't work. TopIndex isn't recognised

mylist.ListIndex = 0 - which doesn't work. i've used listindex incorrectly


any ideas?

thanks
 
I am having the same issue and have not yet found a solution.
 
Hi,


Just a thought, are you able to modify your code to start selecting all items starting from the bottom of the list?
 
Well done DBGuy. It works

Code:
Dim lngC As Long
With Me.LstClasses
   ' For lngC = Abs(.ColumnHeads) To (.ListCount - 1) 'top to bottom
    For lngC = [B](.ListCount - 1) To Abs(.ColumnHeads) Step -1[/B] 'bottom to top
    .Selected(lngC) = True
    Next
End With
 

Users who are viewing this thread

Back
Top Bottom