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