In order for horizontal scrolling to work, you have to call the SetHorizontalExtent method and set the total width of the horizontal space being used by the entries in the ListBox. If the horizontal extent is larger than the client area of the listbox, the horizontal scrollbar will appear, providing you have selected the horizontal scroll style. You need both to be set to get the effect.........
Here is what you are looking for, look at this article :
A CListBox with automatic HSCROLL maintenance : http://www.flounder.com/hs
Download Src code from here : http://www.flounder.com/hs
Instead you may also maintain a value which is the maximum width set whenever a new string is added, update the width,when strings are deleted update the width. Do this by overriding the ResetContent, InsertItem, AddItem, and DeleteString methods.
-MAHESH
Main Topics
Browse All Topics





by: AndyAinscowPosted on 2007-01-23 at 07:01:32ID: 18375168
horizontal scroll bar is only for the multi-column display (instead of all appearing vertically, it fills column 1 then starts column2...).
I don't think there is a simple answer to what you want. (Consider a CListCtrl with just one column intead of a CListBox)