scroll to top of a multi select listbox (1 Viewer)

spinkung

Registered User.
Local time
Today, 23:01
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
 

smollenk

New member
Local time
Today, 15:01
Joined
Oct 23, 2018
Messages
5
I am having the same issue and have not yet found a solution.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:01
Joined
Oct 29, 2018
Messages
21,454
Hi,


Just a thought, are you able to modify your code to start selecting all items starting from the bottom of the list?
 

isladogs

MVP / VIP
Local time
Today, 23:01
Joined
Jan 14, 2017
Messages
18,209
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

Top Bottom