Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1198
  • Last Modified:

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!
0
mahfudz
Asked:
mahfudz
1 Solution
 
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
 
AlexFMCommented:
pEdit->PostMessage(WM_VSCROLL, SB_BOTTOM, 0);
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now