Hello there,<br><br> does anyone know how to attach a horizontal scroll bar to a list box control?<br><br> As ever, any help would be much appreciated,<br><br>Thanks,<br><br> Paul
</a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
I never had a need to have a horizontal bar on a list box. But from what I know if you change the column property to a number like 3 and then fill the columns with data the horizontal scroll bar will display by itself. <br><br>I do not know if that gives you what you want but if the control is "non-flexible" for you. I would try using the Flex grid as a list box.<br><br>Note: I would set the flex grid to display no lines this would make it look visually like a list box.<br><br>If this still does not help and you are wanting to have to controls a list box and a scroll control and have them work together, good luck. If you get it to work e-mail me a sample of your code I may need to use it some day.<br><br><A HREF="mailto:aleaf270@yahoo.com">aleaf270@yahoo.com</A>
You can't just turn them on in the properties...list boxes, by default, only have vertical scrollbars for when the number of list items exceeds the viewable area of the control...let me know what property you have to set if I'm wrong... <br><br>You *can* change the list style of the list box control to list horizontally by setting the columns property, but then I'd just have the same problem, but vertically...<br><br>I'm fairly certain that the solution here is to use a dedicated horizontal scroll-bar control, but I don't know how to tell the listbox control to scroll left and right on a scroll event, as raised by the scrollbar control...<br><br><br>Thanks for having a think, though....<br><br><br>Paul
Ok, this sort of works. (I ran out of time - gotta go home)<br><br>new project, new form, picture box on form, horizontal scroll bar underneath picture box, list box *INSIDE* picture box, list box bigger than picture box so that it's not all visible.<br><br><FONT FACE=monospace><b><br>Option Explicit<br><br>Constant FiddleFactor = 100<br><br>Private Sub Form_Load()<br><br> List1.AddItem "jsahdhsad k dkhsadkjhsa dhaskdhsakhds dkjhsa dkh sakd "<br> List1.AddItem "jsahdhsad k dkhsadkjhsa dhaskdhsakhds dkjhsa dkh sakd "<br> HScroll1.Min = 0<br> HScroll1.Max = List1.Width / FiddleFactor<br><br>End Sub<br><br>Private Sub HScroll1_Change()<br><br> List1.Left = (HScroll1.Value * -1) * FiddleFactor<br><br>End Sub<br></font></b><br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.