Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

auto scrolling down to the end in edit box

Posted on 2004-03-23
6
Medium Priority
?
1,196 Views
Last Modified: 2013-11-20
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
Comment
Question by:mahfudz
6 Comments
 
LVL 8

Expert Comment

by:krbatge
ID: 10662286
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
 
LVL 14

Expert Comment

by:wayside
ID: 10662816
> 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
 
LVL 48

Accepted Solution

by:
AlexFM earned 200 total points
ID: 10665164
pEdit->PostMessage(WM_VSCROLL, SB_BOTTOM, 0);
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question