Remove TRichEdit's Cursor.

I placed a TRichEdit control into a form.  As the TRichEdit box will be set to read-only, I don't want a cursor keep flashing on the edit box.
Is it possible to remove this cursor?  How can I do that?

Thanks.

raymng
RaymondAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

j42Commented:
Place it on a panel and set TPanel.Enabled := False;
0
WyverexCommented:
@j42: That doesn't remove the cursor though.

Add the follwing line to your FormCreate for example:

YourRichEdit.Cursor := crNone;

crNone is not available in the object inspector so you have to set it programmatically.

Voilá! The cursor is hidden when moved over the rich edit.


regards
Wyverex
0
RaymondAuthor Commented:
Wyverex:

Not the mouse cursor, I mean the "cursor" which keeps flashing when you are typing text in the edit box.

raymng
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

lopardo2003Commented:
I would use a timer and use the following code:

HideCaret(MyRichEdit.Handle);
0
RaymondAuthor Commented:
lopardo2003:

Could you further explain your idea? I dont' understand.
Thank you.

raymng
0
lopardo2003Commented:
Add a timer to your form (System page > Timer), select the timer and in the object inspector decrease the interval value (Interval = 10 works fine), now double-clic the timer and the procedure should be as follows:

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  HideCaret(RichEdit1.Handle);
end;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
j42Commented:
> That doesn't remove the cursor though.
Yep, it does!
0
RaymondAuthor Commented:
Thanks lopardo2003 and sorry for the late reply.
I think it is quite resource consuming by using a timer here.

 
0
j42Commented:
What about my suggestion?
0
RaymondAuthor Commented:
Thanks j42. Your solution is good if the TRichedit is only used for displaying something, because the user cannot work with the TRichedit anymore.

0
j42Commented:
Yep, I understand. Copy and paste is disabled. Darn!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.