?
Solved

How to get TRichedit to scroll

Posted on 2001-06-25
5
Medium Priority
?
169 Views
Last Modified: 2010-04-06
How do I make a richedit control automatically scroll as more lines are added to it?
0
Comment
Question by:zebada
[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
  • 3
5 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6225692
An easy way to do it would be like this

TRichedit.SelStart := Length(TRichedit.Text);


The Crazy One
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 6225700
To scroll 3 lines down:

RichEdit1.Perform(EM_LineScroll, 0, 3);


To scroll 3 lines up:

RichEdit1.Perform(EM_LineScroll, 0, -3);
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6225712
Or

RichEdit1.Perform(EM_Scroll, SB_PAGEDOWN, 0);
RichEdit1.Perform(EM_Scroll, SB_PAGEUP, 0);
RichEdit1.Perform(EM_Scroll, SB_LINEDOWN, 0);
RichEdit1.Perform(EM_Scroll, SB_LINEUP, 0);
0
 
LVL 6

Author Comment

by:zebada
ID: 6230644
CrazyOne,
TRichedit.SelStart := Length(TRichedit.Text);
Doesn't seem to work when I am adding lines to the control in the OnActivate mehtod of the first form that is displayed by the application. i.e. before any user interaction has taken place. After that I don't need to do anything except give the control focus and it will follow (scroll) as I add ne lines.

Epsylon,
Thank-you your solution worked although on reading through some of the other messages I chose the EM_SCROLLCARET because I actually wanted to follow the cursor.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6230658
Glad I could help, Thanks.
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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 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