Solved

CEdit: How to keep the scroll bar down?

Posted on 2003-12-05
4
1,714 Views
Last Modified: 2013-11-20
Hi,

I have a multiline CEdit control with a vertical scroll bar.
I am appending strings in it and I want the scroll bar to be always down.

Here's the code I have, which does not work:

int lMinPos;
int lMaxPos;

mMyEditControl.GetScrollRange( SB_VERT, &lMinPos, &lMaxPos );
mMyEditControl.SetScrollPos( lMaxPos, TRUE );


What can I do to make it work?
Thanks!
0
Comment
Question by:benhere
4 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9882699
Use the function SetSel of CEdit with bNoScroll with TRUE.
0
 
LVL 11

Expert Comment

by:KurtVon
ID: 9883285
If you don't want to mess with the current selection, you can also use LineScroll to scroll the edit control.  You can use GetFirstVisibleLine and GetLineCount to make sure it scrolls the last line into view.

Hope this helps.


0
 
LVL 48

Accepted Solution

by:
AlexFM earned 200 total points
ID: 9883290
mMyEditControl.PostMessage(WM_VSCROLL, SB_BOTTOM, 0);
0
 
LVL 2

Author Comment

by:benhere
ID: 9884338
Thanks!
I'll use the PostMessage() method
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
EvenOdd challenge 10 128
mapAB Challlenge 35 159
unix example issues 18 99
"Black Box" Testing of Control System Software 2 72
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…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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