sachelis
asked on
Limit CListCtrl to one column when in LVS_SMALLICON mode
I have CListCtrl that displays text and small icons while in LVS_SMALLICON mode. Occasionally a short text string will result in two list items being displayed on the same row:
I tried using CListCtrl::SetColumnWidth( ), but it doesn't work when in LVS_SMALLICON mode. I tried using LVS_LIST mode and SetColumnWidth() which does fix this problem, but it then only has a horizontal scrollbar and puts information that doesn't fit in the list to the right (whereas I need one long column and a vertical scrollbar).
Thanks.
I tried using CListCtrl::SetColumnWidth(
Thanks.
You could consider using a ListBox (not ListCtrl) instead - that only has one column. (Except if you instruct it to use multi column that is).
ASKER
THanks Andy, but list boxes don't support icons (I'd need to do an owner draw which requires signifiantly more code).
Yeah, but I don't think what you want is possible - at least not without a lot of code either.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
See the explantion for why this, and Sara's, solutions both work. My solution was easier to implement, because our code was already based on a small icon list.