dufylaurent
10-02-2001, 06:26 AM
Can you hide the scrollbar on a list box ???
I have 4 list boxes, synchronized, and I just want to see one scroll bar... Not 4. Do you know how I can do ?
"Never trust a computer you can't throw out a window." Steve Wozniak images/icons/wink.gif
usetheforce2
10-02-2001, 06:38 PM
not sure how you list boxes are synced but could you just set he value of the listindex to the value of the scroll bar in the scroll bar's change event?
something like:
<pre> <font color=blue>For</font color=blue> x = 0 <font color=blue>To</font color=blue> 3
List1(x).ListIndex = VScroll1.Value
<font color=blue>Next</font color=blue>
</pre>
i've attached an example, maybe that'll shed som light!
regan
"The crows seem to be calling his name, thought Caw." - Jack Handy
dufylaurent
10-04-2001, 03:38 AM
Thank´s for you reply. My list boxes are synchronized this way :
Private Sub List1_Scroll()
List2.TopIndex = List1.TopIndex
List3.TopIndex = List1.TopIndex
List4.TopIndex = List1.TopIndex
End Sub
Private Sub List2_Scroll()
List1.TopIndex = List2.TopIndex
List3.TopIndex = List2.TopIndex
List4.TopIndex = List2.TopIndex
End Sub
Private Sub List3_Scroll()
List1.TopIndex = List3.TopIndex
List2.TopIndex = List3.TopIndex
List4.TopIndex = List3.TopIndex
End Sub
Private Sub List4_Scroll()
List1.TopIndex = List4.TopIndex
List2.TopIndex = List4.TopIndex
List3.TopIndex = List4.TopIndex
But doing this, the list boxes have scrollbars appearing since I have a lot of data in it. I try to hide three of them, in order to see on my form the 4 listboxes but only one scrollbar...
for the moment, I put something on the scrollbar so that the user doesn't see them, but I was wondering if something more intelligent could work...
"Never trust a computer you can't throw out a window." Steve Wozniak images/icons/wink.gif
Squirm
10-04-2001, 04:37 PM
That code could be condensed a lot easier with a control array......
<pre>Private Sub List_Scroll(Index As Integer)
Dim i As Integer
For i = 1 to 4
List(i).TopIndex = List(Index).TopIndex
Next i
End Sub</pre>
Not sure what you are trying to do, but have you considered a FlexGrid? If you are trying to maintain columns of data (either bound or unbound) the flexgrid is a very natural choice.
LOL
Hunter
dufylaurent
10-05-2001, 12:16 AM
You are both right. At the time I began to use the list boxes, it was easier, but now I should change my mind. Thanks for the posts, very positive...
"Never trust a computer you can't throw out a window." Steve Wozniak images/icons/wink.gif