The Spell Dialog can be customized three different ways:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub btnSpell_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSpell.Click ' create a spell-checking dialog box Using dlg As New C1SpellDialog() ' connect event handler AddHandler dlg.ErrorDisplayed, AddressOf dlg_ErrorDisplayed ' spell-check the RichTextBox control C1SpellChecker1.CheckControl(Me.RichTextBox, False, dlg) End Using End Sub Private Sub dlg_ErrorDisplayed(ByVal sender As Object, ByVal e As EventArgs) ' get the C1SpellDialog that fired the event Dim dlg As C1SpellDialog = TryCast(sender, C1SpellDialog) ' show information about the error currently displayed ToolStripStatusLabel1.Text = String.Format("Error {0} of {1}: '{2}'", dlg.ErrorIndex + 1, dlg.ErrorCount, dlg.CurrentError.Text) End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void btnSpell_Click(object sender, EventArgs e) { // create a spell-checking dialog box using (C1SpellDialog dlg = new C1SpellDialog()) { // connect event dlg.ErrorDisplayed += new EventHandler(dlg_ErrorDisplayed); // spell-check the RichTextBox c1SpellChecker1.CheckControl(this.richTextBox, 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 toolStripStatusLabel1.Text = string.Format("Error {0} of {1}: '{2}'", dlg.ErrorIndex + 1, dlg.ErrorCount, dlg.CurrentError.Text); } |
OR
OR