Solved

Scrolling TRichEdit

Posted on 2000-03-02
6
248 Views
Last Modified: 2010-04-04
How can I make the TRichEdit scroll along with the text when I automatically add lines to it:

  RichEdit.Lines.Add('Blah');

??
0
Comment
Question by:nrico
[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
6 Comments
 
LVL 7

Expert Comment

by:RBertora
ID: 2576096
Richedit.Setfocus;

then each time you add, use:

SendMessage(RichEdit.Handle,WM_KeyDown,40,0);

Rob;-)
0
 
LVL 1

Author Comment

by:nrico
ID: 2576449
Wait, I forgot to tell the lines are added from a TEdit control, but I want the Edit to keep focus (It's for a chat program -- My friends wanted colors in it :-). So I'd have to keep switching focus, right?
0
 
LVL 7

Expert Comment

by:RBertora
ID: 2576574
No you wouldn't have to change focus all the time. infact you don't have to use setfocus at all.

Rob;-)
0
Independent Software Vendors: 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!

 
LVL 6

Accepted Solution

by:
edey earned 75 total points
ID: 2576766
or you could try this :)


EM_SCROLLCARET

wParam = 0 ;    // not used now; reserved for future use; must be zero
lParam = 0 ;    // not used now; reserved for future use;  must be zero
 

An application sends an EM_SCROLLCARET message to scroll the caret into view in an edit control.




GL
Mike
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2577500
hi,

another way (sample)

you can use this to scroll one line

//Scroll Up
procedure TForm1.Button1Click(Sender: TObject);
begin
  richedit1.Perform(EM_SCROLL,SB_LINEUP,0);
end;

//Scroll Down
procedure TForm1.Button2Click(Sender: TObject);
begin
  richedit1.Perform(EM_SCROLL,SB_LINEDOWN,0);
end;

meikl
0
 
LVL 6

Expert Comment

by:edey
ID: 2602988
Thank you, glad to be of service :)


GL
Mike
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

724 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