How do I force CListCtrl to keep its scrollbar?

In MFC, CListBox has a "disable no scroll" property. When you set it to true, there is always a vertical scrollbar, no matter how many items you have. How can I do the same with CListCtrl?

0


source to share


2 answers


The standard control doesn't seem to support your desired behavior.

You can either create enough entries to make the scrollbar visible, or you can create your own control to implement it however you like. The inbetween will be the ownerdrawn style, but this is not the case for the scrollbar.



BTW: what would be the reason the scrollbar is visible all the time in the list control?

+1


source


Considering you're trying to get a nice view of a report with columns that fit exactly - no horizontal scrolling and no ugly gray bar instead of scrolling.

From memory in the report view, you can add the last column that will fill the rest of the space and cannot be attributed to size. I can't seem to find any suitable code on MSDN at the moment, recalling vaguely the -1 size for the column.



If you keep resizing the columns, I would do this when: - the application finishes adding / removing a set of new items to the report - the user resizes the report window

Also consider why users can't adjust the column size to what they want?

+1


source







All Articles