Solved

Scrolling TRichEdit

Posted on 2000-03-02
6
247 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
Technology Partners: 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

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!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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