auto scrolling down to the end in edit box

hi

i have an edit box control....which acts like some status box.....constantly filled with text

problem is the scroll bar does not automatically move, anyone knows the solution? thanks!
mahfudzAsked:
Who is Participating?
 
AlexFMConnect With a Mentor Commented:
pEdit->PostMessage(WM_VSCROLL, SB_BOTTOM, 0);
0
 
krbatgeCommented:
Whenever you add 1 or more lines of text call LineScroll() and scroll to the last line of the edit control.  

For example if you have a pointer to an your edit box called pEdit try calling

    pEdit->LineScroll(pEdit->GetLineCount());

whenever you add a new status message to it
0
 
waysideCommented:
> pEdit->LineScroll(pEdit->GetLineCount());

This code will only ever show the last line as the top line in the edit box.

You can do something like this to show the last 10 lines:

int nFirstVisible = pmyEdit->GetFirstVisibleLine();
pmyEdit->LineScroll(pmyEdit->GetLineCount()-nFirstVisible-10, 0);

0
All Courses

From novice to tech pro — start learning today.