ComponentOne Spell for .NET: C1Spell Task-Based Help > Showing a Message Box

Showing a Message Box

Displaying a done spell checking message box

To show a message box when the spell checking is complete, enter the following code in the Button1_Click event:

      Visual Basic

' when spell checking is done, give the user some feedback

If Me.C1Spell1.BadWordCount > 0 Then

    MessageBox.Show(("Done spell checking. " + Me.C1Spell1.BadWordCount + " typing errors."))

Else

    MessageBox.Show("Done spell checking. No spelling errors.")

End If

      C#

// when spell checking is done, give the user some feedback

if (this.c1Spell1.BadWordCount > 0)

    MessageBox.Show("Done spell checking. " + this.c1Spell1.BadWordCount + " typing errors.");

else

    MessageBox.Show("Done spell checking. No spelling errors.");

The message box appears when spell checking is complete, showing the total number of misspellings:

 

Displaying an errors message box

The C1Spell component has a SpellError event that is fired if some error has occurred within the component. To show a message box displaying what error has occurred within the C1Spell component, add the following code in the event handler:

      Visual Basic

MessageBox.Show(e.ErrorDesc)

      C#

MessageBox.Show(e.ErrorDesc);


Send comments about this topic to ComponentOne.
Copyright © 1987-2008 ComponentOne LLC. All rights reserved.