• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1201
  • 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

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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