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.
|
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.aspxSo for example, you can handle CTRL+F shortcut in your application, then call the above method when the short cut is pressed. Thanks!
|
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.
|
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!
|