Search matches count

General TRichView support forum. Please post your questions here
Post Reply
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Search matches count

Post by max.beliy »

How I can get all search matches count ?
Sergey Tkachenko
Site Admin
Posts: 17267
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The current version of SearchText method searches from the current position to the first matched place. It does not search in the document above the current position and below the first match.
So, if you need to know the count, you need to block repainting (BeginUpdate), move the caret to the beginning, and call SearchText until it returns False, and calculate the count of succeeded calls, then unblock repainting (EndUpdate).

We plan to improve searching later in this year (to highlight all matched strings).
Post Reply