My application writes a lot of information in a list box.
When the list box is full, the scrool bar get smaller but i can not see the new information because the list box doesn't follow the new display.
I can only see the old displayed information.
I usually create my own listbox control be inherting
from MFC's CListBox.
i.e.,
class CMyListBox : public CListBox
and then add member called something like "LogLine", which
adds a string the end of the listbox scrolls to bottom of
the list box using SendMessage(WM_VSCROLL, SB_BOTTOM, 0).
NB: Make sure the listbox doesn't have the "Sort" property
enabled.
The code also includes a cleanup loop, that deletes from
the top of the listbox when it gets too full.
i.e.,
#define _MYLISTBOX_MAX_SIZE (500)
...
void CMyListBox::LogLine(LPCTSTR lpLog)
{
// Make sure list box never grows too big
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.