Solved

How to get TRichedit to scroll

Posted on 2001-06-25
5
164 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 135
Delphi cmd execution 6 60
When i run adoquery my application freezes 26 166
Why  'Host Connection unavailable/Socket Error #113 No route to host' 6 42
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
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…

772 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