Page 1 of 1

Date/Time Insertion - Cursor Position

Posted: Fri Dec 01, 2006 9:08 pm
by parad0x
Hi,

I am Inserting the Date / Time into a TRichViewEdit from a TListBox from a Seperate Form but everytime I call Format or Reformat or even FormatTail it only Inserts the Date or Time at the bottom of the document.

How can I have it to Insert it at the Current Cursor Position?

Many Thanks

Parad0x

Posted: Fri Dec 01, 2006 9:52 pm
by Sergey Tkachenko
RichViewEdit1.InsertText(DateTimeToStr(Now))

Without Format and Reformat.

Posted: Sat Dec 02, 2006 11:03 am
by parad0x
Thank You. That worked well, I was trying to do AddText instead of InsertText!

Posted: Sat Dec 02, 2006 12:33 pm
by Sergey Tkachenko
Add*** methods must be used for document generation (rv.Clear; several rv.Add***; rv.Format).
For insertion in the caret position, use Insert*** methods (the only exception - InsertRVFFromStream)