Skip to content

Commit 99a713f

Browse files
authored
Update FindOnPage.md
1 parent 0d2f601 commit 99a713f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

FindOnPage.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ bool AppWindow::ConfigureAndExecuteFind(const std::wstring& findTerm)
6464
wil::com_ptr<ICoreWebView2Find> webView2Find;
6565
CHECK_FAILURE(webView2_17->get_Find(&webView2Find));
6666
67-
// Assuming you want to use the default UI, adjust as necessary.
68-
CHECK_FAILURE(webView2Find->put_SuppressDefaultDialog(false));
69-
CHECK_FAILURE(webView2Find->put_ShouldHighlightAllMatches(true));
67+
// By default Find will use the default UI and highlight all matches. If you want different behavior
68+
// you can change the SuppressDefaultDialog and ShouldHighlightAllMatches properties here.
7069
7170
// Start the find operation with a callback for completion.
7271
CHECK_FAILURE(webView2Find->StartFind(
@@ -110,7 +109,6 @@ bool AppWindow::ExecuteFindWithCustomUI(const std::wstring& findTerm)
110109

111110
// Opt for using a custom UI for the find operation.
112111
CHECK_FAILURE(webView2Find->put_SuppressDefaultDialog(true));
113-
CHECK_FAILURE(webView2find->put_ShouldHighlightAllMatches(true));
114112

115113
// Start the find operation with callback for completion.
116114
CHECK_FAILURE(webView2Find->StartFind(
@@ -161,9 +159,8 @@ async Task ConfigureAndExecuteFindWithDefaultUIAsync(string findTerm)
161159
FindDirection = CoreWebView2FindDirection.Forward
162160
};
163161
164-
// Use the default UI provided by WebView2 for the find operation.
165-
webView.CoreWebView2.FindController.SuppressDefaultDialog = false;
166-
webView.CoreWebView2.FindController.ShouldHighlightAllMatches = true;
162+
// By default Find will use the default UI and highlight all matches. If you want different behavior
163+
// you can change the SuppressDefaultDialog and ShouldHighlightAllMatches properties here.
167164
168165
// Start the find operation with the specified configuration.
169166
await webView.CoreWebView2.FindController.StartFindAsync(findConfiguration);

0 commit comments

Comments
 (0)