Mr. Boy
Mr. Boy

Reputation: 63738

Controlling width/layout in CListCtrl (Icon view)

Apart from the fact I still can't see why this class fills columns and scrolls horizontally, rather than filling rows and scrolling vertically, I'm confused how the width of items is controlled. I'm seeing quite a lot of padding (50-80 pixels) between the longest item in a column and the next column which means wasted space.

Is it controllable?

Upvotes: 1

Views: 1684

Answers (1)

Nikola Smiljanić
Nikola Smiljanić

Reputation: 26873

Somebody else asked about scrolling, here is the answer.

If you are referring to column width then you can change it using:

CListCtrl list;
list.InsertColumn(0, _T("Column1"));
list.InsertItem(0, _T("Item with a long name"));
list.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER);

Upvotes: 1

Related Questions