CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    19

    Multi Column - CListBox or CListCntrl

    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



  2. #2
    Join Date
    May 1999
    Location
    Sydney, Australia
    Posts
    420

    Re: Multi Column - CListBox or CListCntrl

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured