Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CEdit: How to keep the scroll bar down?

Posted on 2003-12-05
4
Medium Priority
?
1,720 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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