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. CListCtrl allways show only the first items???

CListCtrl allways show only the first items???

Scheduled Pinned Locked Moved C / C++ / MFC
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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello, i use CListCtrl with virtual list, and i have a problem when i try to scroll down to see other items, CListCtrl jumps to first, allways if i call .SetItemCount() to actualize list content!!! Is there any way to solve this, that i can scroll down in CListCtrl? :confused: Thank you for help! termal

    H 1 Reply Last reply
    0
    • L Lost User

      Hello, i use CListCtrl with virtual list, and i have a problem when i try to scroll down to see other items, CListCtrl jumps to first, allways if i call .SetItemCount() to actualize list content!!! Is there any way to solve this, that i can scroll down in CListCtrl? :confused: Thank you for help! termal

      H Offline
      H Offline
      hameduser
      wrote on last edited by
      #2

      Hi please put your code here, when you call setItemCount?

      L 1 Reply Last reply
      0
      • H hameduser

        Hi please put your code here, when you call setItemCount?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hello, ähm, there is no large code, here a sample:

        // pointer to my list control
        pList->SetItemCount(hashmap.size()); // i store all data in a hash map! ---> stdex::hash_map

        that ist all!:confused: Now if i want to scroll down to other items the focus jump allways to top of the list, or any other previous selected item, that means if i select item no. 15 and i croll down to item no. 2500, by SetItemCount list jumps again back to previous selected item no.15, if no selection jumps to top! Now i try to catch a OnLvnBeginScrollListAll(NMHDR *pNMHDR, LRESULT *pResult) but i get a error: "error C2065: 'LVN_BEGINSCROLL' : undeclared identifier" The msdn say's that i need to include commctrl.h, i have that and the error is again there! I use VS2005! So that is my problem now, maybe you can help me here? regards termal

        modified on Monday, December 17, 2007 9:38:26 AM

        L 1 Reply Last reply
        0
        • L Lost User

          Hello, ähm, there is no large code, here a sample:

          // pointer to my list control
          pList->SetItemCount(hashmap.size()); // i store all data in a hash map! ---> stdex::hash_map

          that ist all!:confused: Now if i want to scroll down to other items the focus jump allways to top of the list, or any other previous selected item, that means if i select item no. 15 and i croll down to item no. 2500, by SetItemCount list jumps again back to previous selected item no.15, if no selection jumps to top! Now i try to catch a OnLvnBeginScrollListAll(NMHDR *pNMHDR, LRESULT *pResult) but i get a error: "error C2065: 'LVN_BEGINSCROLL' : undeclared identifier" The msdn say's that i need to include commctrl.h, i have that and the error is again there! I use VS2005! So that is my problem now, maybe you can help me here? regards termal

          modified on Monday, December 17, 2007 9:38:26 AM

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Solved, with SetItemState(iIndex, /*LVIS_SELECTED | */LVIS_FOCUSED, /*LVIS_SELECTED | */LVIS_FOCUSED ); termal

          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