Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MultiColumn Listbox

MultiColumn Listbox

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RuiSantiago
    wrote on last edited by
    #1

    Hi! I'm new at Visual C++, and i was trying to use a CListBox with multicolumn features, but i cannot find a way to include the column's labels. I guess this must be a easy task for most of you, but i'm really having dificulties in implementing this. Can anyone help me? Please... Thank you in advance

    J 1 Reply Last reply
    0
    • R RuiSantiago

      Hi! I'm new at Visual C++, and i was trying to use a CListBox with multicolumn features, but i cannot find a way to include the column's labels. I guess this must be a easy task for most of you, but i'm really having dificulties in implementing this. Can anyone help me? Please... Thank you in advance

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Do you mean CListBox or CListCtrl? If the former, then all the columns of a single row are inserted at a time by calling AddString with a string where columns are separated by tab characters:

      m_list.AddString("Column 1\tColumn 2\tColumn 3");

      Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      R 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        Do you mean CListBox or CListCtrl? If the former, then all the columns of a single row are inserted at a time by calling AddString with a string where columns are separated by tab characters:

        m_list.AddString("Column 1\tColumn 2\tColumn 3");

        Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        R Offline
        R Offline
        RuiSantiago
        wrote on last edited by
        #3

        Thank's Joaquín, i guess i'll use the CListCtrl once i need the headers to sort data, can you tell where to find some good examples how to use this object? Thank you

        J 1 Reply Last reply
        0
        • R RuiSantiago

          Thank's Joaquín, i guess i'll use the CListCtrl once i need the headers to sort data, can you tell where to find some good examples how to use this object? Thank you

          J Offline
          J Offline
          Joaquin M Lopez Munoz
          wrote on last edited by
          #4

          Here at CP. For instance, Matt Weagle's article Using the List Control. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups