is it possible to scroll one list box and at the same time scroll another..........
This would work two way to the list boxes are appear joined?
Printable View
is it possible to scroll one list box and at the same time scroll another..........
This would work two way to the list boxes are appear joined?
You can use various api calls to set the top visible index (post a message with LB_SETTOPINDEX) etc. Is this the sort of thing your after?
thats right, any idea what the api call is?
pardon?
if your asking what i think your saying then...
There are a bunch of messages you can send to windows using the api calls PostMessage and SendMessage, i.e.
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
where...
hwnd: is the handle of your listbox
wMsg: is the message you will send
( e.g. declare the message LB_SETTOPINDEX by
Const LB_SETTOPINDEX = &H197 )
wParam: is the entry (index - zero based) of the entry you want to appear at the top of the listbox
lParam: set to zero
There are a bunch of other messages you can also use to have more control.
Hope this helps.
Someone asked this question a while ago, and this was the answer. Not mine i might add. :(
use the TopIndex property. If the lists do not have the same number of items you will need to make sure the topindex is not greater than the listcount.
Otherwise, two identical lists will scroll together perfectly.
Code:Private Sub List1_Scroll()
List2.TopIndex = List1.TopIndex
End Sub
Private Sub List2_Scroll()
List1.TopIndex = List2.TopIndex
End Sub