How to always search from start of document

General TRichView support forum. Please post your questions here
Post Reply
kabal
Posts: 6
Joined: Tue Sep 02, 2008 12:05 pm

How to always search from start of document

Post 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
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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));
kabal
Posts: 6
Joined: Tue Sep 02, 2008 12:05 pm

Post by kabal »

that sergey, that works perfectly
Post Reply