Solved

How to get TRichedit to scroll

Posted on 2001-06-25
5
162 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
  • 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 50 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now