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. How can I use CListCtrl's LVS_REPORT

How can I use CListCtrl's LVS_REPORT

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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.
  • A Offline
    A Offline
    Angel Kid
    wrote on last edited by
    #1

    I want to use the CListCtrl's LVS_REPORT ,but I have no idea in using the CListCtrl,anyone could give me a sample or the setps? I could not understand the MSDN 's .Thank . YES, I am here.

    P 1 Reply Last reply
    0
    • A Angel Kid

      I want to use the CListCtrl's LVS_REPORT ,but I have no idea in using the CListCtrl,anyone could give me a sample or the setps? I could not understand the MSDN 's .Thank . YES, I am here.

      P Offline
      P Offline
      Philip Patrick
      wrote on last edited by
      #2

      Well, if you already have your list control on your dialog, those are the steps: (I suppose that m_wndList is the CListCtrl

      m_wndList.ModifyStyle(0, LVS_REPORT); //see CListCtrl::Create for other styles

      //now have to add at least on column. We'll add 2 columns
      m_wndList.InsertColumn(0, "My name");
      m_wndList.InsertColumn(1, "My phone");

      //now we can add items, one after another.
      //I use GetItemsCount to be sure that new items added at the end of list
      //if you want to add at the beginning, just use 0 (zero) instead
      int nItem = m_wndList.InsertItem(m_wndList.GetItemsCount(), "Philip Patrick");
      m_wndList.SetItem(nItem, 1, "111-111-222222");

      That's all :) Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer

      A 1 Reply Last reply
      0
      • P Philip Patrick

        Well, if you already have your list control on your dialog, those are the steps: (I suppose that m_wndList is the CListCtrl

        m_wndList.ModifyStyle(0, LVS_REPORT); //see CListCtrl::Create for other styles

        //now have to add at least on column. We'll add 2 columns
        m_wndList.InsertColumn(0, "My name");
        m_wndList.InsertColumn(1, "My phone");

        //now we can add items, one after another.
        //I use GetItemsCount to be sure that new items added at the end of list
        //if you want to add at the beginning, just use 0 (zero) instead
        int nItem = m_wndList.InsertItem(m_wndList.GetItemsCount(), "Philip Patrick");
        m_wndList.SetItem(nItem, 1, "111-111-222222");

        That's all :) Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer

        A Offline
        A Offline
        Angel Kid
        wrote on last edited by
        #3

        :-O:-O YES, I am here.

        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