Welcome Guest Search | Active Topics | Sign In | Register

Search into html Options
Developer Prius
Posted: Tuesday, September 7, 2021 10:19:15 AM
Rank: Newbie
Groups: Member

Joined: 2/11/2021
Posts: 8
Hello,
In any browser you can search into the page from text. Is there any way to do the same with EO.WebBrowser.WebView?
Like use CTRL+F and search somenthing in the loaded page.

Thanks in advance.
eo_support
Posted: Tuesday, September 7, 2021 10:45:41 AM
Rank: Administration
Groups: Administration

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

Yes. You would use this method to start search:

https://www.essentialobjects.com/doc/eo.webbrowser.webview.startfindsession.aspx

So for example, you can handle CTRL+F shortcut in your application, then call the above method when the short cut is pressed.

Thanks!
Developer Prius
Posted: Tuesday, September 7, 2021 3:30:45 PM
Rank: Newbie
Groups: Member

Joined: 2/11/2021
Posts: 8
Thanks oe_support. Do you have a complete example code? How to use that FindSession object?

Best regards.
eo_support
Posted: Tuesday, September 7, 2021 5:54:58 PM
Rank: Administration
Groups: Administration

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

It's just an object that has several methods and you just call the methods to do what the method does. For example, if your search dialog has a "Next" button, then you can write code to handle the "Next" button's click event and call FindSession.Next() in your event handler. This will move the current selected match to the next match inside the WebView.

The key here is event handling (such as handling Ctrl + F shorcut) and the search UI (such as "Next" and "Previous" button) are your responsibility. The highlighting inside the WebView is done by the WebView, but you need to call the corresponding method to Start/Stop highlighting and move next/previous of the matched item.

Hope this helps.

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.