# AutoCorrect: TWo INitial CApitals

> TX Spell .NET enables AutoCorrect for words with two initial capitals by hooking into the Changed event of TX Text Control. The handler checks each misspelled word for leading uppercase pairs, validates the lowercase form against the dictionary, and replaces the word if valid.

- **Author:** Bjoern Meyer
- **Published:** 2014-07-24
- **Modified:** 2026-07-17
- **Description:** TX Spell .NET enables AutoCorrect for words with two initial capitals by hooking into the Changed event of TX Text Control. The handler checks each misspelled word for leading uppercase pairs, validates the lowercase form against the dictionary, and replaces the word if valid.
- **3 min read** (414 words)
- **Tags:**
  - Spell Checking
  - Tutorial
- **Web URL:** https://www.textcontrol.com/blog/2014/07/24/autocorrect-two-initial-capitals/
- **LLMs URL:** https://www.textcontrol.com/blog/2014/07/24/autocorrect-two-initial-capitals/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2014/07/24/autocorrect-two-initial-capitals/llms-full.txt

---

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](https://www.textcontrol.com/product/tx-spell-dotnet-winforms/), 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](https://s1-www.textcontrol.com/assets/dist/blog/2014/07/24/a/assets/autocorrect.webp "AutoCorrect: TWo INitial CApitals")On the [Changed](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.textcontrol.changed.event.htm) 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](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.misspelledwordcollection.remove.method.htm) 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](https://s1-www.textcontrol.com/assets/dist/blog/2014/07/24/a/assets/txspell_autocorrect.zip) the Visual Studio 2012 project to do your own tests. At least, trials version of [TX Spell .NET for Windows Forms](https://www.textcontrol.com/product/tx-spell-dotnet-winforms/download/) and [TX Text Control .NET for Windows Forms](https://www.textcontrol.com/product/tx-text-control-dotnet-winforms/download/) are required.

Happy coding!

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Web.TextControl and Spell Checking](https://www.textcontrol.com/blog/2015/02/09/webtextcontrol-and-spell-checking/llms.txt)
- [TX Spell .NET: Not Only a Spell Checker](https://www.textcontrol.com/blog/2014/11/28/tx-spell-net-not-only-a-spell-checker/llms.txt)
- [TX Spell .NET: Ignore Word List Using User Dictionaries](https://www.textcontrol.com/blog/2014/01/10/tx-spell-net-ignore-word-list-using-user-dictionaries/llms.txt)
- [TX Spell .NET ActiveX Package Released - Spell Checking in VB6](https://www.textcontrol.com/blog/2012/01/09/tx-spell-net-activex-package-released-spell-checking-in-vb6/llms.txt)
- [Porting RapidSpell to TX Spell .NET](https://www.textcontrol.com/blog/2011/12/22/porting-rapidspell-to-tx-spell-net/llms.txt)
- [Adding Spell Checking to Your TX Text Control Applications](https://www.textcontrol.com/blog/2011/02/10/adding-spell-checking-to-your-tx-text-control-applications/llms.txt)
- [Windows Forms Tutorial: Create Your First Windows Forms C# Application](https://www.textcontrol.com/blog/2024/08/26/windows-forms-tutorial-create-your-first-windows-forms-csharp-application/llms.txt)
- [How to Mail Merge MS Word DOCX Documents in ASP.NET Core C#](https://www.textcontrol.com/blog/2023/10/16/how-to-mail-merge-ms-word-docx-documents-in-aspnet-core-csharp/llms.txt)
- [Creating an Angular Document Editor Application with a Node.js WebSocket Server](https://www.textcontrol.com/blog/2023/08/24/creating-an-angular-document-editor-application-with-a-nodejs-websocket-server/llms.txt)
- [Adding SVG Watermarks to Documents](https://www.textcontrol.com/blog/2022/01/28/adding-svg-watermarks-to-documents/llms.txt)
- [Using MailMerge in ASP.NET Core 6 Web Applications](https://www.textcontrol.com/blog/2022/01/27/using-mailmerge-in-aspnet-core-6-web-applications/llms.txt)
- [DocumentViewer for React Prerelease](https://www.textcontrol.com/blog/2020/10/27/document-viewer-for-react-prerelease/llms.txt)
- [New DocumentViewer Signature Tutorial Sample](https://www.textcontrol.com/blog/2020/08/18/new-documentviewer-signature-tutorial-sample/llms.txt)
- [Creating an ASP.NET MVC DocumentViewer Application With Razor](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-mvc-documentviewer-application-with-razor/llms.txt)
- [Creating Your First Windows Forms Application with C#](https://www.textcontrol.com/blog/2020/01/01/creating-your-first-windows-forms-application-with-csharp/llms.txt)
- [Creating Your First WPF Application](https://www.textcontrol.com/blog/2020/01/01/creating-your-first-wpf-application/llms.txt)
- [Creating a WPF Ribbon Application](https://www.textcontrol.com/blog/2020/01/01/creating-a-wpf-ribbon-application/llms.txt)
- [Integrate Document Editing into any HTML Client using the HTML Widget](https://www.textcontrol.com/blog/2020/01/01/integrate-document-editing/llms.txt)
- [Creating an ASP.NET MVC Application With Razor](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-mvc-application-with-razor/llms.txt)
- [Creating A Windows Forms Ribbon Application](https://www.textcontrol.com/blog/2020/01/01/creating-a-windows-forms-ribbon-application/llms.txt)
- [Creating Your First ASP.NET Reporting Application](https://www.textcontrol.com/blog/2020/01/01/creating-your-first-aspnet-reporting-application/llms.txt)
- [Creating an ASP.NET Web Forms AJAX Application](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-web-forms-ajax-application/llms.txt)
- [Creating a WebSocket Server Project with Node.js](https://www.textcontrol.com/blog/2020/01/01/creating-a-websocket-server-project-with-nodejs/llms.txt)
- [Creating an Angular Document Editor Application](https://www.textcontrol.com/blog/2020/01/01/creating-an-angular-document-editor-application/llms.txt)
- [ReportingCloud .NET Core Quickstart Tutorial](https://www.textcontrol.com/blog/2019/07/24/reportingcloud-dotnet-core-quickstart-tutorial/llms.txt)
