Board index » cppbuilder » Horizontal Scrolling ListBox

Horizontal Scrolling ListBox

Does anybody know how to scroll Listbox horizontally?
When the string length of an item is very long we cannot see all of the
string to the end.
 

Re:Horizontal Scrolling ListBox


When setting up the forms at runtime, send the ListBox a
LB_SETHORIZONTALEXTENT message specifying the maximum viewable width.  The
OS will then automatically handle displaying the horizontal scroll bar when
appropriate:

    ListBox1->Perform(LB_SETHORIZONTALEXTENT, ListBox1->Width, 0);

Why this isn't handled automatically by Windows, or exposed as a property in
the VCL, I have no idea.

Gambit

Quote
"??32(Sunam Lee)" <ddoron...@telusplanet.net> wrote in message

news:3c69d377$1_2@dnews...
Quote
> Does anybody know how to scroll Listbox horizontally?
> When the string length of an item is very long we cannot see all of the
> string to the end.

Re:Horizontal Scrolling ListBox


FWIW, I recall reading (in "About Face?") that if you find the need to
scroll a horizontal listbox, you need to rethink your design. Unless you can
split the pane so that the user can see the left and right at the same time,
horizontal scrolling can be a pain.

Other Threads