我想添加搜索功能到我的页面,使用search_next,search_previous,search_close(清晰选择)功能,同时我想知道关于search_result_count,current_search_result_index的信息。但是CEF中只公开了两个方法:
public void Find(int identifier, string searchText, bool forward, bool matchCase, bool findNext);
public void StopFinding(bool clearSelection);似乎我们首先可以做search_next和search_previous。为了做到这一点,我尝试了如下操作,并且能够按预期的方式向后和向前搜索,但是当我试图搜索其他单词时,它就无效了:
private void previousMouseUp(object sender, MouseButtonEventArgs e)
{
ChromeView.Find(searchIdentifier, searchText, false, isCaseSensitive, true);
}
private void nextMouseUp(object sender, MouseButtonEventArgs e)
{
ChromeView.Find(searchIdentifier, searchText, true, isCaseSensitive, true);
}也没有公开获取搜索结果计数和当前搜索索引的方法。我使用的是41.0.1.0版本。请指导我正确的方向,以达到我的要求?请不要介意我的英语;
发布于 2015-11-16 07:46:53
CefSharp.WinForms.Example有一个Find的基本工作实现。
CEF API文档是http://magpcss.org/ceforum/apidocs3/projects/%28default%29/CefBrowserHost.html#Find%28int,constCefString&,bool,bool,bool%29
https://stackoverflow.com/questions/33615891
复制相似问题