[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Remove TRichEdit's Cursor.

Posted on 2003-11-14
11
Medium Priority
?
303 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
  • 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 1200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month18 days, 2 hours left to enroll

829 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