@@ -34,7 +34,6 @@ the active match index based on the selected Find Direction.
34
34
35
35
``` cpp
36
36
37
- // ! [InitializeFindConfiguration]
38
37
wil::com_ptr<ICoreWebView2FindConfiguration> AppWindow::InitializeFindConfiguration (const std::wstring& findTerm)
39
38
{
40
39
// Query for the ICoreWebView2Environment5 interface.
@@ -52,11 +51,9 @@ wil::com_ptr<ICoreWebView2FindConfiguration> AppWindow::InitializeFindConfigurat
52
51
53
52
return findConfiguration;
54
53
}
55
- //! [ InitializeFindConfiguration]
56
54
```
57
55
58
56
```cpp
59
- //! [ExecuteFindWithDefaultUI]
60
57
bool AppWindow::ConfigureAndExecuteFind(const std::wstring& findTerm)
61
58
{
62
59
auto findConfiguration = InitializeFindConfiguration(findTerm);
@@ -95,11 +92,9 @@ bool AppWindow::ConfigureAndExecuteFind(const std::wstring& findTerm)
95
92
// End user interaction is handled via UI.
96
93
return true;
97
94
}
98
- //! [ExecuteFindWithDefaultUI]
99
95
```
100
96
101
97
``` cpp
102
- // ! [ExecuteFindWithCustomUI]
103
98
bool AppWindow::ExecuteFindWithCustomUI (const std::wstring& findTerm)
104
99
{
105
100
auto findConfiguration = InitializeFindConfiguration(findTerm);
@@ -143,11 +138,9 @@ bool AppWindow::ExecuteFindWithCustomUI(const std::wstring& findTerm)
143
138
144
139
return true;
145
140
}
146
- //! [ ExecuteFindWithCustomUI]
147
141
```
148
142
#### .NET C#
149
143
```csharp
150
- //! [ConfigureAndExecuteFindWithDefaultUI]
151
144
async Task ConfigureAndExecuteFindWithDefaultUIAsync(string findTerm)
152
145
{
153
146
try
@@ -178,11 +171,9 @@ async Task ConfigureAndExecuteFindWithDefaultUIAsync(string findTerm)
178
171
Console.WriteLine($"An error occurred: {ex.Message}");
179
172
}
180
173
}
181
- //! [ConfigureAndExecuteFindWithDefaultUI]
182
174
```
183
175
184
176
``` csharp
185
- // ! [ConfigureAndExecuteFindWithCustomUI]
186
177
async Task ConfigureAndExecuteFindWithCustomUIAsync (string findTerm )
187
178
{
188
179
try
@@ -214,7 +205,6 @@ async Task ConfigureAndExecuteFindWithCustomUIAsync(string findTerm)
214
205
Console .WriteLine ($" An error occurred: {ex .Message }" );
215
206
}
216
207
}
217
- // ! [ConfigureAndExecuteFindWithCustomUI]
218
208
```
219
209
220
210
### Retrieve the Index of the Active Match
@@ -225,7 +215,6 @@ within a WebView2 control using the `GetActiveMatchIndex` method.
225
215
226
216
227
217
``` cpp
228
- // ! [GetActiveMatchIndex]
229
218
bool AppWindow::GetActiveMatchIndex ()
230
219
{
231
220
auto webView2_17 = m_webView.try_query<ICoreWebView2_17>();
@@ -243,7 +232,6 @@ within a WebView2 control using the `GetActiveMatchIndex` method.
243
232
244
233
return true;
245
234
}
246
- //! [ GetActiveMatchIndex]
247
235
248
236
// Register ActiveMatchIndexChanged event handler
249
237
m_webView->add_ActiveMatchIndexChanged(
@@ -258,7 +246,6 @@ within a WebView2 control using the `GetActiveMatchIndex` method.
258
246
```
259
247
#### .NET C#
260
248
```csharp
261
- //! [GetActiveMatchIndex]
262
249
public async Task<int> GetActiveMatchIndexAsync()
263
250
{
264
251
var webViewFind = webView.CoreWebView2.Find; // Assuming webView is your WebView2 control
@@ -275,7 +262,6 @@ void ActiveMatchIndexChangedSample()
275
262
// Update Custom UI based on the new active match index.
276
263
};
277
264
}
278
- //! [GetActiveMatchIndex]
279
265
```
280
266
281
267
## API Details
0 commit comments