Welcome Guest Search | Active Topics | Sign In | Register

StartFindSession not working?? Options
Onymu
Posted: Wednesday, September 14, 2022 11:01:03 AM
Rank: Newbie
Groups: Member

Joined: 9/14/2022
Posts: 1
Im trying to do the StartFindSession function and its working, but when I do the MatchCount, its returning always -1 even with text highlighted.
Code: C#
string word = "Name";
int i = test.WebView.StartFindSession(word, false).MatchCount;

Keep returning -1;

Im trying somethings like:
Code: C#
test.WebView.StartFindSession(word, false).Next();
int i = test.WebView.StartFindSession(word, false).MatchCount;

Keep returning -1;

Code: C#
int i = test.WebView.StartFindSession(word, false).CurrentMatchIndex

Keep returning -1;

eo_support
Posted: Wednesday, September 14, 2022 12:54:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,074
Hi,

This is normal. StartFindSession is asynchronous. So all it does is to tell the browser engine to start searching for the words. You would need to handle the FindSession objects' Updated event in order to get the most recent MatchCount. Note that MatchCount is not fixed. As the browser engine continues to search, it may find more matches and may trigger Updated event again with an updated MatchCount.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.