In today's mobile world and because of the progress made in AutoCorrect technology in smartphones, users get confused, if their desktop application doesn't provide the same functionality.

Using TX Spell .NET, you integrate one of the most powerful spell checking and correction engines into your .NET based applications. Based on the analysis of thousands of documents, the expected suggestion is ranked at position 1 or 2 in more than 97% of all cases. The algorithm includes the measurement of the distance between the keys on the currently used keyboard. Many different factors are evaluated and rated to create the accurate list of suggestions.

A popular feature in MS Office is the AutoCorrect feature TWo INitial CApitals. If a word starts with two initial capitals, but the word itself is not misspelled, it will be corrected automatically.

Using TX Text Control and TX Spell .NET, this feature can be easily implemented.

AutoCorrect: TWo INitial CApitals

On the Changed event of TextControl, all misspelled words are checked whether the first two letters are uppercase. If true and the lower case word is not misspelled, the word is corrected by replacing the upper case character with its lower case counterpart. The corrected word is then replaced in TextControl using the MisspelledWords.Remove method.

private void textControl1_Changed(object sender, EventArgs e)
{
    if (correctTWoINitialCApitalsToolStripMenuItem.Checked == false)
        return;

    // loop through all misspelled words
    foreach (MisspelledWord word in textControl1.MisspelledWords)
    {
        // if the first two initials are uppercase
        if (char.IsUpper(word.Text[0]) && char.IsUpper(word.Text[1]))
        {
            // and the word is not mispelled
            txSpellChecker1.Check(word.Text.ToLower());

            // replace the word
            if (txSpellChecker1.IncorrectWords.Count == 0)
                 textControl1.MisspelledWords.Remove(word,
                     ToUpperFirstLetter(word.Text));
        }
    }
}

// returns a string with the first letter uppercase
public static string ToUpperFirstLetter(string source)
{
    if (string.IsNullOrEmpty(source))
        return string.Empty;

    char[] letters = source.ToLower().ToCharArray();
    letters[0] = char.ToUpper(letters[0]);
    return new string(letters);
}

You can download the Visual Studio 2012 project to do your own tests. At least, trials version of TX Spell .NET for Windows Forms and TX Text Control .NET for Windows Forms are required.

Happy coding!