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. iSubItem always = 0 on many ListCtrl Events

iSubItem always = 0 on many ListCtrl Events

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialdiscussion
2 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.
  • M Offline
    M Offline
    Maverick
    wrote on last edited by
    #1

    In a report style CListCtrl with multiple columns, I have traced on many CListCtrl events that the iSubItem of many ListCtrl STRUCTS is always zero eventhough the current subitem selected is on the columns other than the 1st column... For example: void CResultsFormView::OnLvnItemchangedMyList(NMHDR *pNMHDR, LRESULT *pResult) { LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); NMLVCUSTOMDRAW* pn=(NMLVCUSTOMDRAW*)pNMHDR; NMITEMACTIVATE* nm=(NMITEMACTIVATE*)pNMHDR; LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE) pNMHDR; int item=temp->iItem; int subitem=temp->iSubItem; //even if used all of those STRUCTS //subitem is always zero... } Any thoughts on this problem... "mustang this is ghostrider, requesting flyby..."

    A 1 Reply Last reply
    0
    • M Maverick

      In a report style CListCtrl with multiple columns, I have traced on many CListCtrl events that the iSubItem of many ListCtrl STRUCTS is always zero eventhough the current subitem selected is on the columns other than the 1st column... For example: void CResultsFormView::OnLvnItemchangedMyList(NMHDR *pNMHDR, LRESULT *pResult) { LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); NMLVCUSTOMDRAW* pn=(NMLVCUSTOMDRAW*)pNMHDR; NMITEMACTIVATE* nm=(NMITEMACTIVATE*)pNMHDR; LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE) pNMHDR; int item=temp->iItem; int subitem=temp->iSubItem; //even if used all of those STRUCTS //subitem is always zero... } Any thoughts on this problem... "mustang this is ghostrider, requesting flyby..."

      A Offline
      A Offline
      Andrew Kirillov
      wrote on last edited by
      #2

      Hello You can not select other than the 1st columns item in ListCtrl. The selection is always on the first column or it can be the whole row if you specified an appropriate style. So, for item changed event (and for most list control events) the subitem member will be 0. Andrew

      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