ComponentOne Spell for .NET: C1Spell Task-Based Help > Spell Checking a Paragraph

Spell Checking a Paragraph

The following topic demonstrates the methods, good for windows that hold long documents, of spell checking using the C1Spell class. Complete the following steps:

1.   To put text in the box, double-click the form and enter the following code in the Form_Load event handler:

      Visual Basic

Me.TextBox1.Text = "The C1Spell component features a built-in spelling dialog box, the ability to generate suggestions for bad words, the ability to create new main dictionaries based on existing main dictionaries (such as those created in Microsoft Word), the ability to ignore all or change all bad words, and utilities to build and maintain dictionaries."

      C#

this.textBox1.Text = "The C1Spell component features a built-in spelling dialog box, the ability to generate suggestions for bad words, the ability to create new main dictionaries based on existing main dictionaries (such as those created in Microsoft Word), the ability to ignore all or change all bad words, and utilities to build and maintain dictionaries.";

Note: In order for the TextBox to hold more than one line of text, you must set the TextBox.Multiline property to True. Also, to be able to see misspelled words better, set the TextBox.HideSelection property to False.

2.   To connect the C1Spell component to the button control, add the following code to the Button1_Click event:

      Visual Basic

Me.C1Spell1.CheckControl(Me.TextBox1)

      C#

this.c1Spell1.CheckControl(this.textBox1);

This will check the entire window, displaying the Spelling Check dialog box when a misspelled word is found and listing suggestions when applicable.

This topic illustrates the following:

Misspell a word and the Spelling Check dialog box appears:

 


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