Products Technologies Demo Docs Blog Support Company

Loading Dictionaries Dynamically in TX Spell .NET

To enable spell checking in TX Text Control based applications, you simply need to connect TX Text Control with TX Spell .NET. TX Spell .NET is loading the required dictionaries automatically from the default dictionary folder. Since version TX Text Control X10 and TX Spell .NET 4.0, dictionaries are loaded based on the new Culture at the input position. Consider the following example: If the input language is English, the best match English dictionary is loaded. If the input language…

Loading Dictionaries Dynamically in TX Spell .NET

To enable spell checking in TX Text Control based applications, you simply need to connect TX Text Control with TX Spell .NET. TX Spell .NET is loading the required dictionaries automatically from the default dictionary folder. Since version TX Text Control X10 and TX Spell .NET 4.0, dictionaries are loaded based on the new Culture at the input position.

Consider the following example: If the input language is English, the best match English dictionary is loaded. If the input language switches to German, a German dictionary is loaded automatically. As a developer, you don't need to care about loading matching dictionaries.

Loading dictionaries dynamically in TX Spell .NET

Loading Dictionaries from Shared Locations

But there are scenarios where dictionaries are not loaded from the default local dictionary folder, but must be loaded from a shared location or database. In this case, the dictionaries must be added to the Dictionaries collection:

TXTextControl.Proofing.OpenOfficeDictionary dic =
    new TXTextControl.Proofing.OpenOfficeDictionary("de_DE_frami.dic");
txSpellChecker1.Dictionaries.Add(dic);

The language of the OpenOfficeDictionaries are recognized automatically, so that these added dictionaries are used based on the culture of the input position.

User Dictionaries

User dictionaries can be loaded from files or from memory in the same way like OpenOffice dictionaries. But on loading a user dictionary, you need to specify the Language:

TXTextControl.Proofing.UserDictionary userDic =
    new TXTextControl.Proofing.UserDictionary("userDic.txd");
userDic.Language = new System.Globalization.CultureInfo("en-US");
txSpellChecker1.Dictionaries.Add(userDic);

Provide your users a true multi-language experience and add as many dictionaries as required at the same time to your application.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

Windows FormsWPF.NET

Create a Table of Contents in Windows Forms using C#

This article explains how to create a table of contents in Windows Forms using the ribbon or programmatically. Creating a table of contents is required to organize large documents.


ASP.NETWindows FormsWPF

Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub

This article gives a quick overview of the new repositories, their structure and our plans for the future.


ASP.NETJavaScriptDocument Editor

Detect Toggle Button Changes Using a MutationObserver

This article shows how to detect changes of toggle buttons in the ribbon of the web editor using a MutationObserver. The state of a toggle button in the ribbon visualizes the state of a certain…


Windows FormsList.NET

Two Ways to Restart Numbered Lists in TX Text Control

In TX Text Control, numbered lists are continued by default and need to be reset when required. There is more than one way if you want to restart numbered lists in a document. In this article, two…


Windows FormsSampleShortcuts

Zoom Tricks: Disabling CTRL + MOUSE WHEEL and More

This article shows how to disable CTRL + MOUSE WHEEL, implement zooming with keyboard and reset the zoom factor to its default value.