Make the caret visible

General TRichView support forum. Please post your questions here
Post Reply
armagnac
Posts: 12
Joined: Tue Mar 05, 2024 8:35 am

Make the caret visible

Post by armagnac »

Hi,

I load a TRichViewEdit from a database, then I want the caret be visible at the end of the text. I try

rve.MoveCaret(rvcmBottom, false);

but the caret remains invisible.

How to proceed ?

Thanks
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Make the caret visible

Post by Sergey Tkachenko »

1. Make sure that the editor is formatted. Call rve.Format; (this method moves the caret to the end of the document, so MoveCaret is redundant).
2. Probably the editor is not focused. Call rve.SetFocus.
armagnac
Posts: 12
Joined: Tue Mar 05, 2024 8:35 am

Re: Make the caret visible

Post by armagnac »

rve.Format was done.

The key is really rve.SetFocus : the caret is now visible.

But, strangely, it blinks 5 times then remains frozen (visible but not blinking).

Thank you
standay
Posts: 274
Joined: Fri Jun 18, 2021 3:07 pm

Re: Make the caret visible

Post by standay »

armagnac wrote: Sun Mar 17, 2024 7:54 pm rve.Format was done.

The key is really rve.SetFocus : the caret is now visible.

But, strangely, it blinks 5 times then remains frozen (visible but not blinking).

Thank you
That's a Windows OS thing. The caret in all edit controls stops blinking. A few custom programs override this, and you can change how long it blinks in the registry but I wouldn't recommend it. You can also use the custom caret in the TRichViewEdit to keep it blinking. Sergey can tell you more about that or I think it's in the online help file too.

Stan
Post Reply