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. Reading the Scrollbar of a CListBox/CComboBox

Reading the Scrollbar of a CListBox/CComboBox

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

    hi, I want to make an program that reads the content of a listbox from a different source. The reason is, if there are a 1000 records requested over a network it only has to load the records that are shown. Causing that the user doesn't have to wait for the downloading of all the 1000 records. the way i'm doing it now is by filling the listbox with empty records: for (int i = 0; (!(i > Db.GetCount())); i++) { m_MyListBox.InsertString(i, ""); } Then, Wenn the user wants to see a different part of the listbox i update the data: int cur, max; cur = m_MyListBox.GetScrollPos(SB_VERT); max = Db.GetCount(); if (!(cur + 5 > max)) { max = cur + 5; } for (int i = cur; (!(i > max)); i++) { m_MyListBox.DeleteString(i); m_MyListBox.InsertString(i, Db.GetItem(i)); } Now, I want to run this function wenn the Scrollbar is moved, but i dont know witch message to catch. Anyone have the solution? I hope my explaining of the problem is correct, my english isn't that great... []D [] []D []

    V 1 Reply Last reply
    0
    • W Willem B

      hi, I want to make an program that reads the content of a listbox from a different source. The reason is, if there are a 1000 records requested over a network it only has to load the records that are shown. Causing that the user doesn't have to wait for the downloading of all the 1000 records. the way i'm doing it now is by filling the listbox with empty records: for (int i = 0; (!(i > Db.GetCount())); i++) { m_MyListBox.InsertString(i, ""); } Then, Wenn the user wants to see a different part of the listbox i update the data: int cur, max; cur = m_MyListBox.GetScrollPos(SB_VERT); max = Db.GetCount(); if (!(cur + 5 > max)) { max = cur + 5; } for (int i = cur; (!(i > max)); i++) { m_MyListBox.DeleteString(i); m_MyListBox.InsertString(i, Db.GetItem(i)); } Now, I want to run this function wenn the Scrollbar is moved, but i dont know witch message to catch. Anyone have the solution? I hope my explaining of the problem is correct, my english isn't that great... []D [] []D []

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      Consider LVN_BEGINSCROLL and LVN_ENDSCROLL. Kuphryn

      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