Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Remove TRichEdit's Cursor.

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

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

647 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