Link to home
Start Free TrialLog in
Avatar of pbhugra
pbhugra

asked on

Interesting question on VC++ 5.0

We have a dialog, which has a list box.
We would want to provide Horizontal scroll bars to the list box. We have already tried checking the horizontal control option, but that didnt work out. It works well for Vertical scroll bar. Kindly get back asap
Avatar of Answers2000
Answers2000

The standard list box control can do horizontal or vertical scroll bars but not both.

Your options for a work round:
1. use List View control in details mode.    MFC has the handy CListCtrl class to process this.  These can handle both scroll bars
or
2. Add your own horizontal scroll bar external to the list, and scroll the content of the list box yourself (typically by using OwnerDraw and painting with an appropriate horizontal offset).  If you use message reflection you can handle the scroll bars in a class derived from CListBox and get a reusable list box with both horizontal and vertical scrollbars.

Note to experts, I think answers2000 meant to answer with that.  It seems to be a good answer.
ASKER CERTIFIED SOLUTION
Avatar of Answers2000
Answers2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial