Click to See Complete Forum and Search --> : ListBox (Scrollbar)


ganeshbabu
May 10th, 1999, 05:12 AM
Hi guys,
I want to add an Horizantal scrollbar to a Listbox since the tems displayed are lengthier. If check the property 'H Scroll' It adds horiz..scrollbar. But the listbox items are displayed in manu columns.

What i need is a listbox, which normally has a verti. scroll bar. If the length of the text in it exceeds the display area, a Horizantal scroll bar has to be added automatically to view it.

Thanks,
Ganeshbabu

BrianOG
May 10th, 1999, 06:14 AM
You need to tell the listbox that it needs to activate the horz. scroll bar. It does not figure this out itsself. Each time you add a string, you will have to get the width of the string (using GetTextExtent) and if it if longer than any existing string call SetHorizontalExtent so the listbox knows to show the scroll bar.