'Declaration Public Event Find As FindEventHandler
public event FindEventHandler Find
Event Data
The event handler receives an argument of type FindEventArgs containing data related to this event. The following FindEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Found | Gets a value that determines whether the text was found. |
PageIndex | Gets the page number where the text was found. |
Remarks
The FindEventArgs associated with this event provides details about the found text, including its location and the context in which it was found.
Example
public partial class MyForm : Form { private Viewer viewer; public MyForm() { InitializeComponent(); viewer = new Viewer(); // Subscribe to the Find event viewer.Find += Viewer_Find; this.Controls.Add(viewer); viewer.Dock = DockStyle.Fill; } } private void Viewer_Find(object sender, FindEventArgs e) { if (e.Found) MessageBox.Show($"Text found on page {e.PageIndex + 1}.", "Search", MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show("Text not found.", "Search", MessageBoxButtons.OK, MessageBoxIcon.Information); }
See Also