PDA

Click to See Complete Forum and Search --> : List box help


winapi
Jan 25th, 2000, 10:20 AM
hi, I need a little help with listboxes. Lets say I have list1, list2, and list3 filled with enough info that all 3 have horizontal scroll bars. How can I make my program autoscroll the list boxes with the scroll of any one. IE if I scroll list1 down I want list2 & 3 to scroll with it. Please email me at rlange-csa@home.com

Thanks
Richard

rancor
Jan 25th, 2000, 04:55 PM
Well.. This in not exactly what you asked for but what I know is it not possible to do that in pure VB (maybe with API).. You can maybe use this?

Option Explicit

Dim i As Integer

Private Sub Form_Load()
For i = 1 To 20
List1.AddItem i
List2.AddItem i
List3.AddItem i
Next
End Sub

Private Sub List1_Click()
i = List1.ListIndex
List2.ListIndex = i
List3.ListIndex = i
End Sub

Private Sub List2_Click()
i = List2.ListIndex
List1.ListIndex = i
List3.ListIndex = i
End Sub

Private Sub List3_Click()
i = List3.ListIndex
List1.ListIndex = i
List2.ListIndex = i
End Sub

but If I was you I should use ListView that you finds is Microsoft Common Controls 6.0

and set the property View to lvwReport. It looks just like Explorer's filelist

------------------
Best Regards rancor
rancor@sajberhem.nu
http://www.sajberhem.nu

MartinLiss
Jan 26th, 2000, 11:41 AM
It's actually pretty easy to do. Here is an example where the ListBoxes are members of a control array, but you can adapt this for seperate TextBoxes as well.Private Sub List1_Scroll(Index As Integer)

Select Case Index
Case 0
List1(1).TopIndex = List1(0).TopIndex
List1(2).TopIndex = List1(0).TopIndex
Case 1
List1(0).TopIndex = List1(1).TopIndex
List1(2).TopIndex = List1(1).TopIndex
Case 2
List1(0).TopIndex = List1(2).TopIndex
List1(1).TopIndex = List1(2).TopIndex
End Select

End Sub


------------------
Marty
Why is it called lipstick if you can still move your lips?