Click to See Complete Forum and Search --> : Multi Column - CListBox or CListCntrl


Mark E
May 22nd, 1999, 05:08 AM
Hi,

I want to display data in multi columns. Such as First Name in Column 1, Last Name In Column 2, in a list box of some sort. I thought the CListBox
could do this, But I am having trouble finding info about this. Do I have to use a ClistCtrl, I don't know much about CListCtrl. And could you give me some simple syntax to make 2 columns, and insert strings in each.

Thanks,

- Mark

sally
May 22nd, 1999, 06:38 AM
1) CListBox's multicolumn is a misnomer. What you get is a something like a wrappable column, it is not TRUE multicolumn.
2) You can to use either a) CListBox with tab stops or CListCtrl which is easier.
3) To insert a new row into a CListCtrl, use InsertItem(...). To set texts in sub columns, use SetItemText(...)
4) Make sure you make the control present itself in Report mode, as that is the mode where you will have REAL multiple columns

Sally

Sally
May 22nd, 1999, 06:38 AM
1) CListBox's multicolumn is a misnomer. What you get is a something like a wrappable column, it is not TRUE multicolumn.
2) You can to use either a) CListBox with tab stops or CListCtrl which is easier.
3) To insert a new row into a CListCtrl, use InsertItem(...). To set texts in sub columns, use SetItemText(...)
4) Make sure you make the control present itself in Report mode, as that is the mode where you will have REAL multiple columns

Sally