Page 1 of 1

How to always search from start of document

Posted: Tue Sep 02, 2008 5:08 pm
by kabal
I am doing a lot of document searching, and need to always start at the top.

I assume it is safe to call
TRichEdit.RVData.SearchText instead of TRichEdit.SearchText, so I can specifiy the FromStart param??

Thanks in advance

Posted: Wed Sep 03, 2008 5:19 pm
by Sergey Tkachenko
No, please do not use RVData's method.
You can move the caret to the beginning before the search:

Code: Select all

with RichViewEdit1 do
  SetSelectionBounds(0, GetOffsBeforeItem(0), 0, GetOffsBeforeItem(0));

Posted: Thu Sep 04, 2008 10:45 am
by kabal
that sergey, that works perfectly