?
Solved

Remove TRichEdit's Cursor.

Posted on 2003-11-14
11
Medium Priority
?
298 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
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!

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 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