private void btnSpell_Click(object sender, EventArgs e)
{
// create spell-checking dialog
using (C1SpellDialog dlg = new C1SpellDialog())
{
// connect event handler
dlg.ErrorDisplayed += new EventHandler(dlg_ErrorDisplayed);
// spell-check the 'textBox' control
c1SpellChecker1.CheckControl(this.textBox, false, dlg);
}
}
void dlg_ErrorDisplayed(object sender, EventArgs e)
{
// get the C1SpellDialog that fired the event
C1SpellDialog dlg = sender as C1SpellDialog;
// show information about the error currently displayed
statusLabel1.Text = string.Format("Error {0} of {1}: '{2}'",
dlg.ErrorIndex + 1, dlg.ErrorCount, dlg.CurrentError.Text);
}