[]
Occurs when the Find dialog successfully locates the specified text within the document.
public event FindEventHandler Find
Type | Description |
---|---|
FindEventHandler | Occurs when the Find dialog successfully locates the specified text within the document. |
The FindEventArgs associated with this event provides details about the found text, including its location and the context in which it was found.
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);
}