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. Scrolling a CListBox

Scrolling a CListBox

Scheduled Pinned Locked Moved C / C++ / MFC
comtutorialquestion
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.
  • J Offline
    J Offline
    Jase Jennings
    wrote on last edited by
    #1

    Hi, I'm having big problems trying to scroll a listbox in code. I can set the scrollbar ok, but I can't figure out how to scroll the text properly. Can anybody suggest how i can instruct a CListBox to scroll by a given amount, and have the listbox take care of updating both the scrollbar and the client area (i.e. have it scroll the text correctly). Clearly CListBox knows how to do this, because if i just grab the scrollbar of a standard CListBox, it works. So how do i ask it to do this for me. Effectively, i want to 'emulate' having dragged the scrollbar. Thanks Jase ------------------------------------------------------------------------------------------------------------------------------------------------------------------- View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com

    I 1 Reply Last reply
    0
    • J Jase Jennings

      Hi, I'm having big problems trying to scroll a listbox in code. I can set the scrollbar ok, but I can't figure out how to scroll the text properly. Can anybody suggest how i can instruct a CListBox to scroll by a given amount, and have the listbox take care of updating both the scrollbar and the client area (i.e. have it scroll the text correctly). Clearly CListBox knows how to do this, because if i just grab the scrollbar of a standard CListBox, it works. So how do i ask it to do this for me. Effectively, i want to 'emulate' having dragged the scrollbar. Thanks Jase ------------------------------------------------------------------------------------------------------------------------------------------------------------------- View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      Have a look at LB_SETTOPINDEX / CListBox::SetTopIndex. These should help you. Or you could simply send the listbox WM_VSCROLL messages. Iain Clarke.

      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