?
Solved

CEdit: How to keep the scroll bar down?

Posted on 2003-12-05
4
Medium Priority
?
1,718 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 800 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

777 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