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;
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
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
|