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 do you get the index of a row in a list control

how do you get the index of a row in a list control

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelp
3 Posts 3 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.
  • K Offline
    K Offline
    kingori
    wrote on last edited by
    #1

    hi every one am stuck, this is what i want to do. i have a Report styled list control with 5 columns and i have a double clicked event handler for the list control; so i want to get the index of a row once i double click on it, which list control function do i interrogate, e.g if it was a list box , i would do this; CListBox m_Listbx; .... ... int nSel = m_ListBox.GetCurSel(); now in CListCtrl what function is analogous to CListBox's GetCurSel() and how is it used.. thanks;

    H L 2 Replies Last reply
    0
    • K kingori

      hi every one am stuck, this is what i want to do. i have a Report styled list control with 5 columns and i have a double clicked event handler for the list control; so i want to get the index of a row once i double click on it, which list control function do i interrogate, e.g if it was a list box , i would do this; CListBox m_Listbx; .... ... int nSel = m_ListBox.GetCurSel(); now in CListCtrl what function is analogous to CListBox's GetCurSel() and how is it used.. thanks;

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      GetNextItem(-1,LVNI_SELECTED);.

      1 Reply Last reply
      0
      • K kingori

        hi every one am stuck, this is what i want to do. i have a Report styled list control with 5 columns and i have a double clicked event handler for the list control; so i want to get the index of a row once i double click on it, which list control function do i interrogate, e.g if it was a list box , i would do this; CListBox m_Listbx; .... ... int nSel = m_ListBox.GetCurSel(); now in CListCtrl what function is analogous to CListBox's GetCurSel() and how is it used.. thanks;

        L Offline
        L Offline
        lgbean
        wrote on last edited by
        #3

        GetNextItem() retrun value is an integer.the integer is your need

        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