Solved

Remove TRichEdit's Cursor.

Posted on 2003-11-14
11
296 Views
Last Modified: 2010-04-05
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
0
Comment
Question by:Raymond
[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
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 2

Expert Comment

by:j42
ID: 9747572
Place it on a panel and set TPanel.Enabled := False;
0
 

Expert Comment

by:Wyverex
ID: 9748114
@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
 

Author Comment

by:Raymond
ID: 9753047
Wyverex:

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

raymng
0
Industry Leaders: 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!

 

Expert Comment

by:lopardo2003
ID: 9753171
I would use a timer and use the following code:

HideCaret(MyRichEdit.Handle);
0
 

Author Comment

by:Raymond
ID: 9753203
lopardo2003:

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

raymng
0
 

Accepted Solution

by:
lopardo2003 earned 300 total points
ID: 9755330
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
 
LVL 2

Expert Comment

by:j42
ID: 9762173
> That doesn't remove the cursor though.
Yep, it does!
0
 

Author Comment

by:Raymond
ID: 9844974
Thanks lopardo2003 and sorry for the late reply.
I think it is quite resource consuming by using a timer here.

 
0
 
LVL 2

Expert Comment

by:j42
ID: 9845191
What about my suggestion?
0
 

Author Comment

by:Raymond
ID: 9849919
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
 
LVL 2

Expert Comment

by:j42
ID: 9850945
Yep, I understand. Copy and paste is disabled. Darn!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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