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. setting scrollbars

setting scrollbars

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestutorialquestionannouncementworkspace
5 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.
  • W Offline
    W Offline
    Willem B
    wrote on last edited by
    #1

    hi, can someone tell me how to setup scrollbars. i simply want to make a CListBox that i manually update with data(it's not allowed to use it's own array). If i want to do something like this i need to read the scrollbar and set the scrollbar, but how? i hope you get what i mean? greetz, []D [] []D []

    V 1 Reply Last reply
    0
    • W Willem B

      hi, can someone tell me how to setup scrollbars. i simply want to make a CListBox that i manually update with data(it's not allowed to use it's own array). If i want to do something like this i need to read the scrollbar and set the scrollbar, but how? i hope you get what i mean? greetz, []D [] []D []

      V Offline
      V Offline
      Vladimir Georgiev
      wrote on last edited by
      #2

      Try putting a scroll bar on the List box, and use SetCurSel and GetCurSel methods. This will scroll automatically to the selection you want. Hope it helps... "Needless redundancy is the hobgoblin of software engineering." - Peter Darnell

      W 1 Reply Last reply
      0
      • V Vladimir Georgiev

        Try putting a scroll bar on the List box, and use SetCurSel and GetCurSel methods. This will scroll automatically to the selection you want. Hope it helps... "Needless redundancy is the hobgoblin of software engineering." - Peter Darnell

        W Offline
        W Offline
        Willem B
        wrote on last edited by
        #3

        thats only possible with a ListBox that already contains the info. i think i explaint it wrong. i have a linked-list with about 2000 records. if i load all these record into the CListBox i get 2 problems: 1. it takes too long to load. 2. it takes too much memory. So this would be the solution: The listbox get's filled with the first 10 records. These records are shown. Once the user wants to see (for example) record 500 till 510, the listbox is updated with those 10 records(record 500 - 510). It seems like the ListBox contains all those 2000 records but in fact it only contains 10 records and keeps updating them(like a terminal). In order to know witch selection must be shown i need to read the ScrollList of the ListBox(or make one myself). I also have to virtually make the ScrollList(make it seem like there are 2000 records in the list), but i have no clue how to do this. Can somebody tell me this? []D [] []D []

        R 1 Reply Last reply
        0
        • W Willem B

          thats only possible with a ListBox that already contains the info. i think i explaint it wrong. i have a linked-list with about 2000 records. if i load all these record into the CListBox i get 2 problems: 1. it takes too long to load. 2. it takes too much memory. So this would be the solution: The listbox get's filled with the first 10 records. These records are shown. Once the user wants to see (for example) record 500 till 510, the listbox is updated with those 10 records(record 500 - 510). It seems like the ListBox contains all those 2000 records but in fact it only contains 10 records and keeps updating them(like a terminal). In order to know witch selection must be shown i need to read the ScrollList of the ListBox(or make one myself). I also have to virtually make the ScrollList(make it seem like there are 2000 records in the list), but i have no clue how to do this. Can somebody tell me this? []D [] []D []

          R Offline
          R Offline
          Roger Allen
          wrote on last edited by
          #4

          Sounds like you need to use a ListControl with ownerData (you can ste in resources). This lets you populate it only with the items that need to be shown at any given time. I have never done it myself, so beyound that I can;t be any extra help. Possibly examples of this in the ListControl section here at CP. Roger Allen Sonork 100.10016 Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003

          W 1 Reply Last reply
          0
          • R Roger Allen

            Sounds like you need to use a ListControl with ownerData (you can ste in resources). This lets you populate it only with the items that need to be shown at any given time. I have never done it myself, so beyound that I can;t be any extra help. Possibly examples of this in the ListControl section here at CP. Roger Allen Sonork 100.10016 Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003

            W Offline
            W Offline
            Willem B
            wrote on last edited by
            #5

            yes, thats what i need, but i've searched in the articles but the only thing i can find is pushbuttons for scrolling up and down in a CListBox, well for me thats the easy way out but not what i want. thanks for your help, i'll have to find another solution. []D [] []D []

            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