Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Box Control Horizontal Scroll Bar

Status
Not open for further replies.

NFI

Programmer
Jun 7, 2000
278
0
0
GB
Hello there,<br><br>&nbsp;does anyone know how to attach a horizontal scroll bar to a list box control?<br><br>&nbsp;&nbsp;&nbsp;As ever, any help would be much appreciated,<br><br>Thanks,<br><br>&nbsp;Paul
 
you can turn them on in the ListBox properties. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </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 &quot;non-flexible&quot; 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...&nbsp;&nbsp;<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>&nbsp;&nbsp;&nbsp;&nbsp;List1.AddItem &quot;jsahdhsad k dkhsadkjhsa dhaskdhsakhds dkjhsa dkh sakd &quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;List1.AddItem &quot;jsahdhsad k dkhsadkjhsa dhaskdhsakhds dkjhsa dkh sakd &quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;HScroll1.Min = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;HScroll1.Max = List1.Width / FiddleFactor<br><br>End Sub<br><br>Private Sub HScroll1_Change()<br><br>&nbsp;&nbsp;&nbsp;&nbsp;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= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top