Welcome Guest Search | Active Topics | Sign In | Register

CommandIds.Find not implemented? Options
Peavy
Posted: Friday, July 10, 2015 7:31:22 PM
Rank: Advanced Member
Groups: Member

Joined: 6/26/2015
Posts: 98
I'm trying to add a keyboard shortcut that would show the Chrome "find on page" controls using the following code:

Code: C#
browser.WebBrowser.Shortcuts = new EO.WebBrowser.Shortcut[]
            {
                //Ctrl + F triggers CommandIds.Find command
                new EO.WebBrowser.Shortcut(CommandIds.Find, KeyCode.F, true, false, false)
    
            };


But nothing happens when I run this and hit "CTRL+F". When I change it to CommandIds.Back and KeyCode.Back, it works fine, so I know my code is executing correctly. Has the Find command been implemented in your tool? If so is there a reason this could be failing? If not, is there a reason you list CommandIds.Find?

Thanks for your help.
eo_support
Posted: Friday, July 10, 2015 9:32:18 PM
Rank: Administration
Groups: Administration

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

It's a mistake that CommandIds.Find exists. Find feature has two parts:

1. Displaying the find dialog to prompt user to enter the text they wish to find. This is probably what "Ctrl+F" should trigger;
2. Find the text entered in step 1 in the WebView;

Part #1 does not have anything to do with the WebView and the WebView does not have any built-in implementation for this. Part #2 is supported by the WebView but it can't function alone without part #1.

It is possible for you to support Find shortcuts as long as you provide the UI for part #1. You can follow these steps to implement this:

1. Handle the WebView's Command event and display your UI for #1;
2. When user press OK or enter in your UI, call this method to start a search:

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

Next you can keep calling this method:

http://www.essentialobjects.com/doc/eo.webbrowser.findsession.next.aspx

You can call this method to cancel the search:

http://www.essentialobjects.com/doc/eo.webbrowser.webview.stopallfindsessions.aspx

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.