Can I add multiple columns in MFC CListBox?

13.4k Views Asked by At

I have a dialog with a CListBox .I have to add 3 Columns in this list box.
Is there any way to have several different columns in CListBox ?
Or Can CListCtrl help in this regard?

1

There are 1 best solutions below

0
On BEST ANSWER
  • Listbox has list of items in 1 column, a list-control can have zero or more columns.
  • Natively, listbox does not have icon attached to it, list control has.
  • List control has "header control" on top of it, which can be used to arrange and/or sort the items in columns.
  • List Control (also know as report control) can have 4 or more view types (depending on OS) - icon, small icon, details/report, list and thumbnail.

The windows explorer file view (right side) is list control, fonts in Fonts dialog box is listbox.

Source : http://forums.codeguru.com/showthread.php?358739-CListBox-and-CListCtrl.

use CListCtrl::InsertColumn to add new column.