Page 1 of 1

Make the caret visible

Posted: Sun Mar 17, 2024 12:24 pm
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

Re: Make the caret visible

Posted: Sun Mar 17, 2024 7:20 pm
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.

Re: Make the caret visible

Posted: Sun Mar 17, 2024 7:54 pm
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

Re: Make the caret visible

Posted: Sun Mar 17, 2024 10:30 pm
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