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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollbar

Status
Not open for further replies.

eveCalypso

Programmer
Apr 29, 2003
134
GB
Good Day,
I am reading values into a listbox - and I sort of assumed it would give me scrollbars when it needs to, however -
no Horizontal scrollbar appears when the values get too large (string).
I can not see any Scrollbar properties in the Properties Window either.

Am I missing something really small here?!

Any advice/help would be appreciated.

Regards,
EvE
 
I don't think listbox comes with a HScroll bar..! If you have a string longer than the width of the box..then probably you need to increase the width ! Sorry !!

 
Oh dear :)
Not exactly what I wanted to hear, but hey! Thank you for letting me know!

Rgds,
EvE
 
Hi EvE,

Make sure that your column width isn't less then your ListBox width. I just checked this in Excel VBA with a 1 column ListBox.

I set the list box width to 40 and left the column width blank. I added an Item that was 100 characters long and I got a Horizontal ScrollBar.

After changing the column width to 30 (< ListBox width), using the same 100 character Item I didn't get a Horizontal ScrollBar.

Hope this works for you.

If you can't be &quot;The Best&quot;, be the best at what you can!!!

Never say Never!!!
Nothing is impossible!!!
 
Hi eveCalypso,

Bowers74 is correct. The Listbox DOES come with a horizontal scroll built in to accommodate columns which are too wide for the box, but the scrolling won't show you text which is too long for a column within the listbox. Also you will get the scrollbar whether or not the text fits the visible part of the listbox - it is based on column width and not text length. Individual columns do NOT expand to take text which is too long for them (and, I wouldn't want them to) - in the same way that textboxes don't expand - and Excel cells don't expand - and they don't come with any kind of scrolling.

Enjoy,
Tony
 
Ah,
Hello All,
Thank you for that! I will play around with the widths and
see what it gives me.

Don't worry Bowers74, I never give up ;-)
I also agree with you Mr Jollans, I will make sure there is
a good trade-off between what is possible and what is desirable!

Best Regards,
EvE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top