TX Spell .NET Programmer's Guide

Welcome to TX Spell .NET, the powerful .NET spell checking component. TX Spell .NET enables you to add high-performance spell checking capabilities to your applications.

TX Spell .NET can be used with an unlimited number of dictionaries and user dictionaries at the same time, which enables users to check multi-lingual documents. TX Spell .NET supports the freely available and deployable Hunspell dictionaries of OpenOffice. That provides you access to more than 60 languages. TX Spell .NET has been built from ground up to match the key principles performance, reliability and accuracy.

TX Spell .NET enjoys a deep integration within TX Text Control. Integrating TX Spell .NET into TX Text Control requires no code - it can be easily connected using the Visual Studio designer. Using TX Spell .NET, it is possible to perform spell checking on multiple TextControls on a single form. It is not necessary to have one instance of the spell checker, for each instance of TextControl. This dramatically reduces the required memory and speeds up the spell checking process.

  • Introduction

    This section provides information about the system requirements you need and how to obtain support.

  • What's New

    This part discusses the new features introduced in the last TX Spell releases.

  • Windows Forms User's Guide

    This guide describes how to create TX Spell .NET Windows Forms applications with Visual Studio and shows how to use TX Spell .NET in combination with TX Text Control .NET for Windows Forms.

  • WPF User's Guide

    This guide describes how to create TX Spell .NET WPF applications with Visual Studio and shows how to use TX Spell .NET in combination with TX Text Control .NET for WPF.

  • Resource Kit

    This chapter shows how to use the resource kit that enables developers to display TX Spell .NET's user interface parts in languages other than English and German.

  • Distributing your Applications

    This chapter lists the TX Spell .NET files that must be deployed with your applications.

  • Dictionaries, Hyphenation and Synonym Lists

    This section shows how to use dictionaries, hyphenation and synonym lists with TX Spell .NET.

  • Class Library Reference

    The TX Spell .NET class library in detail and alphabetical order.


Introduction

This section provides information about the system requirements you need and how to obtain support.

System Requirements

How to Obtain Support

Legal Notice


System Requirements

TX Spell .NET requires one of the following Windows versions:

  • Windows 7
  • Windows 8
  • Windows 10

TX Spell .NET supports the following development enviroments:

  • Microsoft Visual Basic .NET
  • Microsoft Visual C# .NET

TX Spell .NET supports the following Microsoft .NET Frameworks:

  • .NET 4.0
  • .NET 4.5
  • .NET 4.6
  • .NET 4.7
  • .NET 4.8
  • .NET Core 3.1
  • .NET 5
  • .NET 6


How to Obtain Support

Introduction

Every registered and free trial version user can benefit from our free, technical support.

Our support team provides several information sources for technical details. A good starting point for getting information is the Source Code Library. This library has samples that are not provided in this release and is updated with new samples frequently.

If you would like to contact us via e-mail, please use the Support Form.

We understand that there are some support cases where a one-to-one talk can solve some programming problem much quicker than endless e-mails.

Our customer services representatives and support agents speak English and German and are available to assist with all your sales and technical queries.

Contact Information

Please visit our website for contact details:

http://www.textcontrol.com/contact/info/


Legal Notice

Information in this document is subject to change without notice and does not represent a commitment on the part of Text Control GmbH. The Software described in this document is furnished under a license agreement. The Software may only be used or copied in accordance with the terms of this agreement.

Copyright 1991-2021 Text Control GmbH. All rights reserved.

Microsoft, Windows, Visual Basic .NET, Visual C#, Visual Studio are either registered trademarks or trademarks of Microsoft Corporation in the USA and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.


What's New

This part discusses the new features introduced in the last TX Spell releases.

What's New in Version 9.0

What's New in Version 8.0

What's New in Version 7.0

What's New in Version 6.0

What's New in Version 5.0

What's New in Version 4.0

What's New in Version 3.0


What's New in Version 9.0

The following provides a general list of features that have been added since TX Spell .NET version 8.0.

New Features and Update Notes

New Classes, Properties, Methods and Events


New Features and Update Notes

TX Spell .NET 9.0 provides the following new features:

New Features

Feature | Description
Customizing default directory paths | By default four directories are required to make use of the TX Spell .NET features spell checking, hyphenation, creating synonyms and detecting language scopes: the Dictionaries, HyphenationLists, SynonymLists and LanguageRecognition folders. On a development machine, these folders are located in the \Assembly\ subdirectory in the TX Spell .NET installation directory. When the application is deployed to an end-user's machine, TX Spell .NET looks for these directories in the application's root folder. With TX Spell .NET 9.0, the location of these subfolders can be determined by specifying a directory path with the corresponding properties DictionariesDirectoryPath, HyphenationListsDirectoryPath SynonymListsDirectoryPath and LanguageRecognitionDirectoryPath.
ShowDialog Settings | With TX Spell .NET 9.0, the ShowDialogSettings class provides the possibility to determine the start position and the owner of the built-in options or spell check dialog. To specify these settings for the spell check dialog, the TXSpellChecker.SpellChecker.ShowDialogSettings property is provided. The options dialog can be modified by setting an instance of the ShowDialogSettings class as a parameter to the OptionsDialog method.
Supporting all platforms | TX Spell 9.0 is compatible with .NET Core 3.1, .NET 5 and .NET 6. All platform dependent system calls have been replaced, so that TX Spell .NET can now be deployed to all supported platforms including Windows, Linux and macOS operating systems.


New Classes, Properties, Methods and Events

In TX Spell 9.0 the following new classes, properties, methods and events have been added:

Classes

Class | Description
TXTextControl.Proofing.ShowDialogSettings | The ShowDialogSettings class provides the possibility to determine the start position and the owner of the built-in options or spell check dialog.
TXTextControl.WPF.Proofing.ShowDialogSettings | The ShowDialogSettings class provides the possibility to determine the start position and the owner of the built-in options or spell check dialog.

Properties

Property | Description
TXTextControl.Proofing.SpellCheckDialog.Location | Returns the point that represents the upper-left corner of the SpellCheckDialog form in screen coordinates.
TXTextControl.Proofing.SpellCheckDialog.ShowDialogSettings | Gets or sets an instance of the ShowDialogSettings class to determine the SpellCheckDialog form's start position and owner.
TXTextControl.Proofing.TXSpell.DictionariesDirectoryPath | Gets or sets the path to the default dictionaries folder.
TXTextControl.Proofing.TXSpell.HyphenationListsDirectoryPath | Gets or sets the path to the default hyphenation lists folder.
TXTextControl.Proofing.TXSpell.LanguageRecognitionDirectoryPath | Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text.
TXTextControl.Proofing.TXSpell.SynonymListsDirectoryPath | Gets or sets the path to the default synonym lists folder.
TXTextControl.Proofing.TXSpellChecker.DictionariesDirectoryPath | Gets or sets the path to the default dictionaries folder.
TXTextControl.Proofing.TXSpellChecker.HyphenationListsDirectoryPath | Gets or sets the path to the default hyphenation lists folder.
TXTextControl.Proofing.TXSpellChecker.LanguageRecognitionDirectoryPath | Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text.
TXTextControl.Proofing.TXSpellChecker.SynonymListsDirectoryPath | Gets or sets the path to the default synonym lists folder.
TXTextControl.WPF.Proofing.SpellCheckDialog.Location | Returns the point that represents the upper-left corner of the SpellCheckDialog window in screen coordinates.
TXTextControl.WPF.Proofing.SpellCheckDialog.ShowDialogSettings | Gets or sets an instance of the ShowDialogSettings class to determine the SpellCheckDialog window's start position and owner.
TXTextControl.WPF.Proofing.TXSpellChecker.DictionariesDirectoryPath | Gets or sets the path to the default dictionaries folder.
TXTextControl.WPF.Proofing.TXSpellChecker.HyphenationListsDirectoryPath | Gets or sets the path to the default hyphenation lists folder.
TXTextControl.WPF.Proofing.TXSpellChecker.LanguageRecognitionDirectoryPath | Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text.
TXTextControl.WPF.Proofing.TXSpellChecker.SynonymListsDirectoryPath | Gets or sets the path to the default synonym lists folder.


What's New in Version 8.0

The following provides a general list of features that have been added since TX Spell .NET version 8.0.

New Features and Update Notes

New Classes, Properties, Methods and Events


New Features and Update Notes

TX Spell .NET 8.0 provides the following new features:

New Features

Feature | Description
Per-Monitor DPI Awareness | Starting with Windows 10 Creators Update (1703) the application's view depends on the DPI of the display that its main window is primarily located on. In Windows Forms TX Spell supports now multiple-monitor setups where each display has a different scale factor and the application is moved from one display to another. In this case TX Spell changes the DPI scaling factor of the spell check and options dialog dynamically. This is also done when making a display-scale-factor change while the application is running. In the .NET Framework (starting with version 4.7) enhanced high DPI support is an opt-in feature. It must be configured in your application's app.config file to take advantage of it.
User Dictionary Performance Improvement | With TX Spell .NET 8.0, adding a user dictionary decreases significantly the loading time and memory footprint.
Special Character Support in User Dictionaries | By default, an OpenOfficeDictionary supports special character flags such as WORDCHARS, to define a list of additional word characters, the BREAK flag, that provides characters that are handled both as character and delimiter, and the ICONV flat, that defines characters that have to be interpreted as another string when spell checking text. Now, when determining these flags at the begining of a user dictionary file, TX Spell spell checks a text under these specified conditions.
Hiding Dictionaries | In some cases it is preferable to load a dictionary that is not accessible by the TX Spell options dialog. To enforce such a behavior on a dictionary, the Proofing.Dictionary.ShowInOptionsDialog property is provided, that informs the options dialog whether or not it is displayed in its Dictionaries overview.


New Classes, Properties, Methods and Events

In TX Spell 8.0 the following new classes, properties, methods and events have been added:

Properties

Property | Description
TXTextControl.Proofing.Dictionary.ShowInOptionsDialog | Gets or sets a value indicating whether the dictionary is shown in the options dialog.


What's New in Version 7.0

The following provides a general list of features that have been added since TX Spell .NET version 7.0.

New Features and Update Notes

New Classes, Properties, Methods and Events


New Features and Update Notes

TX Spell .NET 7.0 provides the following new features:

New Features

Feature | Description
Synonyms | TX Spell .NET 7.0 implements the new method TXSpell.CreateSynonyms that returns an array of synonym groups where each group represents a collection of synonyms with common meaning. These synonyms are based on thesaurus files which are represented by synonym list objects. These lists are automatically used by the first and the second overload of the TXSpell.CreateSynonyms method when they were added to the TXSpell.SynonymLists collection or can directly committed to the third overload of that method.
UserDictionary File Path | To ascertain the name and path of the file where a user dictionary was loaded from or saved to, the UserDictionary provides the FilePath property.
.NET Framework | TX Spell .NET 7.0 has been compiled with .NET Framework 4.0.


New Classes, Properties, Methods and Events

In TX Spell 7.0 the following new classes, properties, methods and events have been added:

Classes

Class | Description
TXTextControl.Proofing.Synonym | The Synonym class represents a synonym for a specific word or phrase.
TXTextControl.Proofing.SynonymGroup | The SynonymGroup class refers to a collection of synonyms with common meaning to the word or phrase that was determined by the TXSpell.CreateSynonyms method.
TXTextControl.Proofing.SynonymList | The SynonymList class represents a synonym list that gets its content from a thesaurus file.
TXTextControl.Proofing.SynonymListCollection | An instance of the SynonymListCollection class contains all objects of type SynonymList that will be used by the first and second overload of the TXSpell.CreateSynonyms method.

Properties

Property | Description
TXTextControl.Proofing.TXSpell.AvailableSynonymLists | Gets a list of all available synonym lists of the default synonym lists folder.
TXTextControl.Proofing.TXSpell.SynonymLanguage | Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true.
TXTextControl.Proofing.TXSpell.SynonymLists | Gets a collection of all added synonym lists.
TXTextControl.Proofing.TXSpellChecker.AvailableSynonymLists | Gets a list of all available synonym lists of the default synonym lists folder.
TXTextControl.Proofing.TXSpellChecker.SynonymLanguage | Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true.
TXTextControl.Proofing.TXSpellChecker.SynonymLists | Gets a collection of all added synonym lists.
TXTextControl.Proofing.UserDictionary.FilePath | Gets the name and path of the file that has been used to load this user dictionary or where it has been saved to.
TXTextControl.WPF.Proofing.TXSpellChecker.AvailableSynonymLists | Gets a list of all available synonym lists of the default synonym lists folder.
TXTextControl.WPF.Proofing.TXSpellChecker.SynonymLanguage | Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true.
TXTextControl.WPF.Proofing.TXSpellChecker.SynonymLists | Gets a collection of all added synonym lists.

Methods

Method | Description
TXTextControl.Proofing.TXSpell.CreateSynonyms | Returns groups of synonyms that represent equivalent expressions for a specific text.
TXTextControl.Proofing.TXSpellChecker.CreateSynonyms | Returns groups of synonyms that represent equivalent expressions for a specific text.
TXTextControl.WPF.Proofing.TXSpellChecker.CreateSynonyms | Returns groups of synonyms that represent equivalent expressions for a specific text.


What's New in Version 6.0

The following provides a general list of features that have been added since TX Spell .NET version 6.0.

New Features and Update Notes

New Classes, Properties, Methods and Events


New Features and Update Notes

TX Spell .NET 6.0 provides the following new features:

New Features

Feature | Description
SpellingCorrectionUIProvider | The SpellingCorrectionUIProvider class provides methods and properties for creating custom spell checking user interfaces. Basically, the UI provider class enables the creation of complete spell checking interfaces based on data binding instead of handling events. The work-flow is handled internally and can be integrated using data binding. The connection between the user interface and the spell checking logic results in automated updates in the UI and the data that reflect the changes. Handlers are available for various tasks such as the CorrectionHandler, the PreviewHandler, the SuggestionDictionariesHandler and the SuggestionsHandler. Those handlers provide properties and methods to process the specific task. The StateManager handles the current state of a spelling correction procedure.


New Classes, Properties, Methods and Events

In TX Spell 6.0 the following new classes, properties, methods and events have been added:

Classes

Class | Description
TXTextControl.Proofing.SpellingCorrectionUIProvider | The SpellingCorrectionUIProvider class provides methods and properties for constructing a spelling correction user interface.
TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler | The CorrectionHandler class provides methods and properties which are necessary to construct the correction handling part of a spelling correction user interface.
TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandler | The PreviewHandler class provides properties which are necessary to construct an editable preview for a spelling correction user interface.
TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager | The StateManager class provides methods and properties which are necessary to initialize, modify and perceive the current state of a spelling correction procedure..
TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler | The SuggestionDictionariesHandler class provides properties which are necessary to perceive and modify suggestion dictionaries in a spelling correction user interface.
TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler | The SuggestionsHandler class provides properties which are necessary to modify and perceive a list of suggestions for correcting the current word to corrct in a spelling correction user interface.

Properties

Property | Description
TXTextControl.Proofing.IncorrectWordChangingEventArgs.Cancel | Get or sets a value indicating whether the changing operation for the current incorrect word should be canceled.
TXTextControl.Proofing.MisspelledWordChangingEventArgs.Cancel | Get or sets a value indicating whether the changing operation for the current misspelled word should be canceled.
TXTextControl.Proofing.TXSpell.SpellingCorrectionUIProvider | Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.
TXTextControl.Proofing.TXSpellChecker.SpellingCorrectionUIProvider | Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.
TXTextControl.WPF.Proofing.TXSpellChecker.SpellingCorrectionUIProvider | Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.


What's New in Version 5.0

The following provides a general list of features that have been added since TX Spell .NET version 5.0.

New Features and Update Notes

New Classes, Properties, Methods and Events


New Features and Update Notes

TX Spell .NET 5.0 provides the following new features:

New Features

Feature | Description
Language Detection | TX Spell .NET 5.0 implements the new method DetectLanguageScopes that detects language scopes from a given string or complete document for more than 30 languages. The algorithm supports nested scopes such as bracketed text or bi-directional (dextrosinistral and sinistrodextral) text in various, mixed languages. The language detection engine requires a very low sampling size - it can detect the language from a single sentence with 4 or more words. It is not resource intensive, and returns the detected language(s) very fast. The results are added to the LanguageScopeCollection. The languages that are used to detect language scopes in a text can be defined by the TXSpell.DetectableLanguageScopes property.


New Classes, Properties, Methods and Events

In TX Spell 5.0 the following new classes, properties, methods and events have been added:

Classes

Class | Description
TXTextControl.Proofing.LanguageScope | The LanguageScope class represents a text scope with a specific language.
TXTextControl.Proofing.LanguageScopeCollection | An instance of the LanguageScopeCollection class contains all detected language scopes for a specific text.

Properties

Property | Description
TXTextControl.Proofing.TXSpell.DetectableLanguageScopes | Gets or sets a list of all languages that are used to detect language scopes in a text.
TXTextControl.Proofing.TXSpell.LanguageScopes | Gets a collection of all detected language scopes.
TXTextControl.Proofing.TXSpellChecker.DetectableLanguageScopes | Gets or sets a list of all languages that are used to detect language scopes in a text.
TXTextControl.Proofing.TXSpellChecker.LanguageScopes | Gets a collection of all detected language scopes.
TXTextControl.WPF.Proofing.TXSpellChecker.DetectableLanguageScopes | Gets or sets a list of all languages that are used to detect language scopes in a text.
TXTextControl.WPF.Proofing.TXSpellChecker.LanguageScopes | Gets a collection of all detected language scopes.

Methods

Method | Description
TXTextControl.Proofing.TXSpell.DetectLanguageScopes | Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpell.LanguageScopes.
TXTextControl.Proofing.TXSpellChecker.DetectLanguageScopes | Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpellChecker.LanguageScopes.
TXTextControl.WPF.Proofing.TXSpellChecker.DetectLanguageScopes | Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpellChecker.LanguageScopes.


What's New in Version 4.0

The following provides a general list of features that have been added since TX Spell .NET version 4.0.

New Features and Update Notes

New Classes, Properties, Methods and Events


New Features and Update Notes

TX Spell .NET 4.0 provides the following new features:

New Features

Feature | Description
Multilingual Hyphenation Support | TX Spell .NET 4.0 provides various methods to hyphenate words by utilizing Hunspell hyphenation dictionaries. It returns the next hyphenation point before a specific word divide position or an array of all hyphenation points for a specific word. A hyphenation list can be added to the TXSpellChecker.HyphenationLists collection by using the TXSpellChecker.HyphenationLists.Add method or setting the TXSpellChecker.HyphenationLanguage property. The HyphenationList class provides properties to adjust the settings for the defined hyphenation list. The method GetHyphenationPoint uses that hyphenation list, that was set as default by using the TXSpellChecker.Hyphenation property. GetHyphenationPoints uses the hyphenation list from the TXSpellChecker.HyphenationLists collection or the default hyphenation list folder where the language property corresponds to a defined language.
Language Specific Spell Checking | TX Spell .NET 4.0 provides additional implementations of the TXSpellChecker.Check and TXSpellChecker.CreateSuggestions methods. These overloads enable spell checking of a specific text and the creation of suggestions with all dictionaries of a given language.
'Right-to-left' Dictionary Support | TX Spell .NET 4.0 implements specific support for dictionaries of 'right-to-left' languages such as Arabic, Farsi, Hebrew and Urdu.
Improved Dictionary Memory Footprint | The memory footprint of TX Spell .NET has been decreased by storing loaded dictionaries in an efficient and more compressed way. This allows TX Spell .NET to work with more dictionaries at the same time which is essential for multilanguage spell checking and hyphenation.
Dictionary Loading Performance | In order to increase performance and usability, significant improvements have been implemented in TX Spell .NET 4.0. The loaded dictionaries are loaded asynchronously which increases the overall initialization performance. The LoadDictionaryDelayed property specifies whether a dictionary is loaded partially when added to the TXSpell.Dictionaries collection or not. If set to true, it is possible to spell check text while the dictionary is still loading. This relation between having dictionaries loaded into memory and spell checker performance allows for optimum spell checking results.


New Classes, Properties, Methods and Events

In TX Spell 4.0 the following new classes, properties, methods and events have been added:

Classes

Class | Description
TXTextControl.Proofing.HyphenationList | The HyphenationList class represents a list of hyphenation rules that gets its content from a Hunspell Open Source hyphenation dictionary.
TXTextControl.Proofing.HyphenationListCollection | An instance of the HyphenationListCollection class contains all objects of type HyphenationList that can be used to create hyphenations.

Properties

Property | Description
TXTextControl.Proofing.DictionaryCollection.LoadDictionaryDelayed | Gets or sets a value indicating whether a dictionary is loaded on adding to the TXSpell.Dictionaries dictionary collection partially or not.
TXTextControl.Proofing.TXSpell.AvailableHyphenationLists | Gets a list of all available hyphenation lists of the default hyphenation lists folder.
TXTextControl.Proofing.TXSpell.HyphenationLanguage | Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true.
TXTextControl.Proofing.TXSpell.HyphenationLists | Gets a collection of all added hyphenation dictionaries.
TXTextControl.Proofing.TXSpellChecker.AvailableHyphenationLists | Gets a list of all available hyphenation lists of the default hyphenation lists folder.
TXTextControl.Proofing.TXSpellChecker.HyphenationLanguage | Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true.
TXTextControl.Proofing.TXSpellChecker.HyphenationLists | Gets a collection of all added hyphenation dictionaries.
TXTextControl.WPF.Proofing.TXSpellChecker.AvailableHyphenationLists | Gets a list of all available hyphenation lists of the default hyphenation lists folder.
TXTextControl.WPF.Proofing.TXSpellChecker.HyphenationLanguage | Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true.
TXTextControl.WPF.Proofing.TXSpellChecker.HyphenationLists | Gets a collection of all added hyphenation dictionaries.

Methods

Method | Description
TXTextControl.Proofing.TXSpell.GetHyphenationPoint | Returns the next hyphenation point for a specific word right before a defined divide position.
TXTextControl.Proofing.TXSpell.GetHyphenationPoints | Returns an array of all hyphenation points for a word.
TXTextControl.Proofing.TXSpellChecker.GetHyphenationPoint | Returns the next hyphenation point for a specific word right before a defined divide position.
TXTextControl.Proofing.TXSpellChecker.GetHyphenationPoints | Returns an array of all hyphenation points for a word.
TXTextControl.WPF.Proofing.TXSpellChecker.GetHyphenationPoint | Returns the next hyphenation point for a specific word right before a defined divide position.
TXTextControl.WPF.Proofing.TXSpellChecker.GetHyphenationPoints | Returns an array of all hyphenation points for a word.


What's New in Version 3.0

The following provides a general list of features that have been added since TX Spell .NET version 2.0.

New Features and Update Notes

New Classes, Properties, Methods and Events


New Features and Update Notes

TX Spell .NET 3.0 provides the following new features:

New Features

Feature | Description
Improved Suggestion Quality | The quality of the suggestions has been improved. Based on the analysis of thousands of test documents, the expected suggestion is now ranked at position 1 or 2 in more than 97% of all test cases. The distance between the keys on the currently used keyboard is measured and the results are evaluated and rated.
New SpellCheckDialog | TX Spell .NET 3.0 provides a Proofing.TXSpellChecker.SpellCheckDialog that can be customized and used with TX Text Control or any other controls such as the RichTextBox, a simple TextBox or a GridView. You can even use one dialog for more controls in a single pass.
New Events | TX Spell .NET 3.0 provides events when dictionaries are added or removed, words are added or removed to or from user dictionaries or buttons have been clicked in the new customizable Proofing.TXSpellChecker.SpellCheckDialog.
Dictionaries from Memory | OpenOfficeDictionaries and UserDictionaries can be added and saved from and to a string array. This allows the addition of dictionaries from memory or from databases.
Create Context Menus Easily | The new Proofing.TXSpellChecker.GetMenuItems method returns an array of ready-to-use Proofing.MenuItems for the integration into your own context menu. You can easily combine your own menus with the spell checking specific entries such as AddToDictionary, Delete, IgnoreAll, IgnoreOnce, NoSuggestions and Suggestion.


New Classes, Properties, Methods and Events

In TX Spell 3.0 the following new classes, properties, methods and events have been added:

Classes

Class | Description
TXTextControl.Proofing.DialogButton | The DialogButton class represents a button of the built-in SpellCheckDialog.
TXTextControl.Proofing.DialogButtonCollection | An instance of the DialogButtonCollection class contains all objects of type DialogButton that represent the dialog buttons of the built-in SpellCheckDialog.
TXTextControl.Proofing.DialogButtonEventArgs | The DialogButtonEventArgs class provides data for the TXSpellChecker.DialogButtonClicked event in TX Spell .NET for Windows Forms.
TXTextControl.Proofing.DictionaryAddedEventArgs | The DictionaryAddedEventArgs class provides data for the TXSpellChecker.DictionaryAdded event in TX Spell .NET for Windows Forms and WPF.
TXTextControl.Proofing.DictionaryRemovedEventArgs | The DictionaryRemovedEventArgs class provides data for the TXSpellChecker.DictionaryRemoved event in TXSpell for Windows Forms and WPF.
TXTextControl.Proofing.IncorrectWordChangingEventArgs | The IncorrectWordChangingEventArgs class provides data for the TXSpellChecker.IncorrectWordChanging event in TX Spell .NET for Windows Forms and WPF.
TXTextControl.Proofing.MenuItem | The MenuItem class provides the possibility to build a menu strip with the most common TX Spell .NET features.
TXTextControl.Proofing.MenuItemClickedEventArgs | The MenuItemClickedEventArgs class provides data for the TXSpellChecker.MenutItemClicked event in TX Spell .NET for Windows Forms.
TXTextControl.Proofing.MisspelledWordChangingEventArgs | The MisspelledWordChangingEventArgs class provides data for the TXSpellChecker.MisspelledWordChanging event in TXSpell for Windows Forms and WPF.
TXTextControl.Proofing.OptionsDialogOpeningEventArgs | The OptionsDialogOpeningEventArgs class provides data for the TXSpellChecker.OptionsDialogOpening event in TXSpell for Windows Forms.
TXTextControl.Proofing.Preview | The Preview class describes and handles attributes of the SpellCheckDialog's preview component.
TXTextControl.Proofing.SpellCheckDialog | The SpellCheckDialog class provides the possibility to modify and show the built-in spell check dialog.
TXTextControl.Proofing.SpellCheckDialogClosingEventArgs | The SpellCheckDialogClosingEventArgs class provides data for the TXSpellChecker.SpellCheckDialogClosing event in TX Spell .NET for Windows Forms.
TXTextControl.Proofing.SpellCheckDialogOpeningEventArgs | The SpellCheckDialogOpeningEventArgs class provides data for the TXSpellChecker.SpellCheckDialogOpening event in TXSpell for Windows Forms.
TXTextControl.Proofing.SpellCheckDialogStateManager | Provides methods and properties for the StateManager property that provided by the SpellCheckDialogOpeningEventArgs, DialogButtonEventArgs and the SpellCheckDialogClosingEventArgs in TX Spell .NET for Windows.Forms.
TXTextControl.Proofing.SuggestionDictionaryComboBox | The SuggestionDictionaryComboBox class describes and handles attributes of the spell check dialog's suggestion dictionary combo box.
TXTextControl.Proofing.SuggestionList | The SuggestionList class describes and handles attributes of the SpellCheckDialog's suggestion list.
TXTextControl.Proofing.UserDictionaryWordAddedEventArgs | The UserDictionaryWordAddedEventArgs class provides data for the UserDictionaryWordAdded event in TX Spell .NET for Windows Forms and WPF.
TXTextControl.Proofing.UserDictionaryWordRemovedEventArgs | The UserDictionaryWordRemovedEventArgs class provides data for the UserDictionaryWordRemoved event in TX Spell .NET Windows Forms and WPF.
TXTextControl.WPF.Proofing.DialogButton | The DialogButton class represents a button of the built-in SpellCheckDialog.
TXTextControl.WPF.Proofing.DialogButtonCollection | An instance of the DialogButtonCollection class contains all objects of type DialogButton that represent the dialog buttons of the built-in SpellCheckDialog.
TXTextControl.WPF.Proofing.DialogButtonEventArgs | The DialogButtonEventArgs class provides data for the TXSpellChecker.DialogButtonClicked event in TX Spell .NET for WPF.
TXTextControl.WPF.Proofing.MenuItem | The MenuItem class provides a method to build a menu strip with the most common TX Spell .NET features.
TXTextControl.WPF.Proofing.MenuItemClickedEventArgs | The MenuItemClickedEventArgs class provides data for the TXSpellChecker.MenuItemClicked event in TX Spell .NET for WPF.
TXTextControl.WPF.Proofing.OptionsDialogOpeningEventArgs | The OptionsDialogOpeningEventArgs class provides data for the TXSpellChecker.OptionsDialogOpening event in TXSpell for WPF.
TXTextControl.WPF.Proofing.Preview | The Preview class describes and handles attributes of the SpellCheckDialog's preview component.
TXTextControl.WPF.Proofing.SpellCheckDialog | The SpellCheckDialog class provides a method to modify and show the built-in spell check dialog.
TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs | The SpellCheckDialogClosingEventArgs class provides data for the TXSpellChecker.SpellCheckDialogClosing event in TX Spell .NET for WPF.
TXTextControl.WPF.Proofing.SpellCheckDialogOpeningEventArgs | The SpellCheckDialogOpeningEventArgs class provides data for the TXSpellChecker.SpellCheckDialogOpening event in TX Spell for WPF.
TXTextControl.WPF.Proofing.SpellCheckDialogStateManager | Provides methods and properties for the StateManager property that is provided by the SpellCheckDialogOpeningEventArgs, DialogButtonEventArgs and the SpellCheckDialogClosingEventArgs in TX Spell .NET for WPF.
TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox | The SuggestionDictionaryComboBox class describes and handles attributes of the spell check dialog's suggestion dictionary combo box.
TXTextControl.WPF.Proofing.SuggestionList | The SuggestionList class describes and handles attributes of the SpellCheckDialog's suggestion list.

Properties

Property | Description
TXTextControl.Proofing.Dictionary.Language | Gets or sets the dictionary's language.
TXTextControl.Proofing.DictionaryCollection.HasEditableUserDictionaries | Gets a value indicating whether the dictionary collection contains editable user dictionaries.
TXTextControl.Proofing.SpelledWord.Index | Gets the index of the spelled word to the corresponding collection.
TXTextControl.Proofing.TXSpell.AvailableDictionaries | Gets a list of all available dictionaries of the default dictionary folder.
TXTextControl.Proofing.TXSpellChecker.AvailableDictionaries | Gets a list of all available dictionaries in the default dictionary folder.
TXTextControl.Proofing.TXSpellChecker.SpellCheckDialog | Gets an object of type SpellCheckDialog that is used to modify and show the built-in SpellCheckDialog.
TXTextControl.WPF.Proofing.TXSpellChecker.AvailableDictionaries | Gets a list of all available dictionaries in the default dictionary folder.
TXTextControl.WPF.Proofing.TXSpellChecker.SpellCheckDialog | Gets an object of type SpellCheckDialog that is used to modify and show the built-in SpellCheckDialog.

Methods

Method | Description
TXTextControl.Proofing.TXSpellChecker.GetMenuItems | Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.
TXTextControl.WPF.Proofing.TXSpellChecker.GetMenuItems | Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.

Events

Event | Description
TXTextControl.Proofing.TXSpellChecker.DialogButtonClicked | Occurs when a dialog button of the built-in SpellCheckDialog was clicked.
TXTextControl.Proofing.TXSpellChecker.DictionaryAdded | Occurs when a dictionary was added to the TXSpellChecker.Dictionaries DictionaryCollection.
TXTextControl.Proofing.TXSpellChecker.DictionaryRemoved | Occurs when a dictionary was removed from the TXSpellChecker.Dictionaries DictionaryCollection.
TXTextControl.Proofing.TXSpellChecker.IncorrectWordChanging | Occurs when an object of type IncorrectWord is changing by spell check context menu or spell check dialog operations.
TXTextControl.Proofing.TXSpellChecker.MenuItemClicked | Occurs when a MenuItem is clicked.
TXTextControl.Proofing.TXSpellChecker.MisspelledWordChanging | Occurs when an object of type TXTextControl.MisspelledWord is changing by spell check context menu or spell check dialog operations.
TXTextControl.Proofing.TXSpellChecker.OptionsDialogOpening | Occurs when a the built-in options dialog is invoked by the TXSpellChecker.OptionsDialog method or clicking the Options... button of the built-in SpellCheckDialog.
TXTextControl.Proofing.TXSpellChecker.SpellCheckDialogClosing | Occurs when the built-in spell check dialog is closing.
TXTextControl.Proofing.TXSpellChecker.SpellCheckDialogOpening | Occurs when the built-in spell check dialog is invoked using the SpellCheckDialog.Show method.
TXTextControl.Proofing.TXSpellChecker.UserDictionaryWordAdded | Occurs when a word is added to a user dictionary.
TXTextControl.Proofing.TXSpellChecker.UserDictionaryWordRemoved | Occurs when a word is removed from a user dictionary.
TXTextControl.WPF.Proofing.TXSpellChecker.DialogButtonClicked | Occurs when a dialog button of the built-in SpellCheckDialog is clicked.
TXTextControl.WPF.Proofing.TXSpellChecker.DictionaryAdded | Occurs when a dictionary is added to the TXSpellChecker.Dictionaries DictionaryCollection.
TXTextControl.WPF.Proofing.TXSpellChecker.DictionaryRemoved | Occurs when a dictionary is removed from the TXSpellChecker.Dictionaries DictionaryCollection.
TXTextControl.WPF.Proofing.TXSpellChecker.IncorrectWordChanging | Occurs when an object of type IncorrectWord is changing by spell check context menu or spell check dialog operations.
TXTextControl.WPF.Proofing.TXSpellChecker.MenuItemClicked | Occurs when a MenuItem is clicked.
TXTextControl.WPF.Proofing.TXSpellChecker.MisspelledWordChanging | Occurs when an object of type TXTextControl.MisspelledWord is changing by spell check context menu or spell check dialog operations.
TXTextControl.WPF.Proofing.TXSpellChecker.OptionsDialogOpening | Occurs when the built-in options dialog is invoked by the TXSpellChecker.OptionsDialog method or clicking the Options... button of the built-in SpellCheckDialog.
TXTextControl.WPF.Proofing.TXSpellChecker.SpellCheckDialogClosing | Occurs when the built-in spell check dialog is closing.
TXTextControl.WPF.Proofing.TXSpellChecker.SpellCheckDialogOpening | Occurs when the built-in spell check dialog is invoked using the SpellCheckDialog.Show method.
TXTextControl.WPF.Proofing.TXSpellChecker.UserDictionaryWordAdded | Occurs when a word is added to a user dictionary.
TXTextControl.WPF.Proofing.TXSpellChecker.UserDictionaryWordRemoved | Occurs when a word is removed from a user dictionary.


Windows Forms User's Guide

This guide describes how to create TX Spell .NET Windows Forms applications with Visual Studio and shows how to use TX Spell .NET in combination with TX Text Control .NET for Windows Forms.

Tutorial: Starting with Microsoft Visual Studio 2019 and TX Text Control

TX Text Control: Using a customizable SpellCheckDialog

TX Text Control: Using TX Spell .NET with multiple TX Text Control instances

TX Text Control: Using a custom spell check ContextMenu

TX Text Control: Using a customizable SpellCheckDialog with multiple TextControls

TX Text Control: Using a customizable SpellCheckDialog with different TextParts

RichTextBox: Using a customizable SpellCheckDialog

RichTextBox: Using a customizable SpellCheckDialog with multiple RichTextBoxes

RichTextBox: Using a custom spell check ContextMenu

RichTextBox: Using TX Spell .NET with multiple RichTextBox instances

Using user dictionaries with TX Spell .NET

Spell checking simple Windows Forms TextBoxes

Modify Spell Check Dialog

Hyphenation with TX Spell .NET

SpellingCorrectionUIProvider: Creating a spelling correction user interface.


Tutorial: Starting with Microsoft Visual Studio 2019 and TX Text Control

TX Spell .NET is the perfect addition for TX Text Control to add professional, high-performance and reliable spell checking to your applications. Furthermore, combined with TX Text Control version 29.0, TX Spell .NET enables a fast way to hyphenate documents, detect language scopes and create synonyms.

This getting started tutorial is the shortcut to use TX Spell .NET for Windows Forms within Microsoft Visual Studio.

The source code for all steps is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\Simple
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\Simple

1. Start Visual Studio and create a new project. Select either Visual Basic or C# as a project type, and Windows Forms App (.NET Framework) as a template and confirm with Next. In the following dialog, choose a name and location and confirm with Create.

2. Find the TX Text Control 29.0 toolbox tab that was created automatically. All usable TX Text Control controls or components are listed in this tab.

3. Click on the TextControl icon and draw it on the form. Now, click on the Smart Tag in the upper right corner of the TextControl. To add the additional controls of TX Text Control, click on Add a Ribbon, Add a Status Bar, Add a Ruler and Add a Vertical Ruler. Finally, click on Arrange Controls Automatically. The controls are now connected and docked automatically.

4. On the form, select the ribbon control by clicking the blue File tab title in order to click on the Smart Tag in the upper right corner of the ribbon control. To add a ribbon tab that handles proofing features, click on Add a RibbonProofingTab.

5. Find the TX Spell 9.0 toolbox tab in Visual Studio. Drag and drop an instance of TXSpellChecker to your form. It is displayed in the component tray at the bottom of the form.

6. Click on the inserted TextControl and find the SpellChecker property in the Properties window. Click on the drop-down box and select the inserted TXSpellChecker instance.

7. In the same window, find the IsSpellCheckingEnabled property of TextControl and set it to true.

8. To enable hyphenation, set the IsHyphenationEnabled property of TextControl to true.

9. To enable language detection, set the IsLanguageDetectionEnabled property of TextControl to true.

Build and start the application to see the first results. The spell-as-you-type functionality and the English dictionary is enabled by default. Misspelled words are underlined automatically and can be corrected by using the shipped right-click context menu. Using this menu, you can open the integrated dialog box as well. In addition, on reaching the end of a line, the last word is hyphenated by using the corresponding English hyphenation list.

Selecting the RibbonProofingTab provides an interface to handle the main features of the SpellChecker. The corresponding spell checking and hyphenation buttons are toggled. The other buttons provide options to correct misspelled words, create synonyms, set and detect languages, as well as to handle spell checking, hyphenation, thesaurus settings.


TX Text Control: Using a customizable SpellCheckDialog

Windows Forms User's Guide

When TX Spell .NET is connected to an instance of TextControl, a context menu and a pre-configured SpellCheckDialog is provided automatically. This SpellCheckDialog is opened by TX Text Control and cannot be customized. In order to customize the dialog box, the SpellCheckDialog from TX Spell .NET can be used.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\SpellCheckDialog
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\SpellCheckDialog

Using a customizable SpellCheckDialog

Principally, the integrated SpellCheckDialog of TX Spell .NET can be used with all types of input controls. If used in combination with TX Text Control, the handling is completely automated and no additional code is required. The SpellCheckDialog method can be easily called with a TextControl instance given in the constructor as a parameter:

[C#]
txSpellChecker1.SpellCheckDialog.Show(textControl1);
[Visual Basic]
txSpellChecker1.SpellCheckDialog.Show(textControl1)

After starting the sample program, simply click on the Spell Check Dialog... button to open the fully customizable user dialog box.


TX Text Control: Using TX Spell .NET with multiple TX Text Control instances

Windows Forms User's Guide

TX Spell .NET is the perfect addition for TX Text Control to add professional, high-performance and reliable spell checking to your applications. TX Spell .NET enjoys a deep integration within the main word processing component. Integrating TX Spell .NET for Windows Forms into TX Text Control requires no code - it can be easily connected using the Visual Studio designer. To increase performance, the spelling dialog is opened by TX Text Control and not TX Spell .NET. The dialog that is opened by TX Text Control is pre-configured and can't be customized. Alternatively, you can call a fully customizable SpellCheckDialog from TX Spell .NET.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\Multiple controls
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\Multiple controls

Using TX Spell .NET with multiple TX Text Control instances

A high-performance spell checker requires a well-considered concept to work with multiple controls on a form in the same application. A single TX Spell .NET instance can be used with multiple instances of TextControl. It is not necessary to have one instance of the spell checker, for each instance of TextControl. This dramatically reduces the required memory and speeds up the spell checking process.

The concept of using multiple instance of TextControl with the same instance of TX Spell .NET is very straightforward. It is not neccessary to switch manually between the controls. Different from other spell checker components, the connection between the consuming control and TX Spell .NET is set with TextControl. To connect TX Spell .NET with the TextControl, the SpellChecker property of each TextControl must be connected to the same TX Spell .NET instance.

After starting the application, each connected TextControl uses the same TX Spell .NET instance and therefore the same resources, dictionaries and user dictionaries.


TX Text Control: Using a custom spell check ContextMenu

Windows Forms User's Guide

When TX Spell .NET is connected to a TextControl through the SpellChecker property, TextControl provides a pre-defined spell check context menu that can be used to replace the misspelled word, open the SpellCheckDialog or to open the options user dialog. But sometimes, it is required to create a customizable context menu or to include the spell check menu items into an existing menu.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\Context menu strip
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\Context menu strip

Using a custom spell check ContextMenu

TX Spell .NET provides the GetMenuItems method that returns ready-to-use menu items that can be inserted into an existing ContextMenuStrip. The method accepts a misspelled word, the connected TextControl instance and the maximum number of returned suggestions.

[C#]
TXTextControl.Proofing.MenuItem[] items = txSpellChecker1.GetMenuItems(misspelledWord, textControl1, 5);
[Visual Basic]
Dim items As TXTextControl.Proofing.MenuItem() = txSpellChecker1.GetMenuItems(misspelledWord, textControl1, 5)

TX Spell .NET provides different MenuItemTypes for different purposes such as deleting, ignoring or to add a word to a user dictionary.

Start the sample application and right-click on a misspelled word (red zig-zag line). You can replace the misspelled word with a correct suggestion, you can ignore it or you can add it to the user dictionary.


TX Text Control: Using a customizable SpellCheckDialog with multiple TextControls

Windows Forms User's Guide

An unique advantage of TX Spell .NET is that a single instance of the spell check component can be used to provide spell checking capabilities to an unlimited number of controls. To enable spell checking for a TextControl, the SpellChecker property of TextControl must be simply set to the specific TXSpellChecker instance.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\SpellCheckDialog on multiple controls
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\SpellCheckDialog on multiple controls

Using a customizable SpellCheckDialog with multiple TextControls

If a customizable SpellCheckDialog is used, the Proofing.TXSpellChecker.SpellCheckDialogClosing event can be used to link to another TextControl when the current control has been checked completely. This allows to usage of one instance of the dialog to spell check an unlimited number of TextControls.

[C#]
private void txSpellChecker1_SpellCheckDialogClosing(object sender,
    TXTextControl.Proofing.SpellCheckDialogClosingEventArgs e) {

    if (e.StateManager.NextMisspelledWord != null) {
        // The dialog was closed by user before checking all misspelled words.
        return;
    }
    e.Cancel = SetNextTextControl(e.StateManager, curTextControl);
}
[Visual Basic]
Private Sub txSpellChecker1_SpellCheckDialogClosing(sender As Object, _
    e As TXTextControl.Proofing.SpellCheckDialogClosingEventArgs)
    If e.StateManager.NextMisspelledWord IsNot Nothing Then
        ' The dialog was closed by user before checking all misspelled words.
        Return
    End If
    e.Cancel = SetNextTextControl(e.StateManager, curTextControl)
End Sub

Start the sample application and click on the button Spell Check Dialog. The dialog checks each of the four TextControls and every contained TextPart such as headers, footers or text frames.


TX Text Control: Using a customizable SpellCheckDialog with different TextParts

Windows Forms User's Guide

The customizable SpellCheckDialog is very flexible and can be used in many different ways. Consider a situation where only specific TextParts such as headers and footers or specific text frames should be spell checked or ignored during the checking process.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\SpellCheckDialog on specific text parts
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\SpellCheckDialog on specific text parts

Using a customizable SpellCheckDialog with different TextParts

The SpellCheckDialogStateManager class provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog. In this sample, an overload is used that provides the possibility to indicate a specific TextPart to spell check.

[C#]
stateManager.SetNext(misspelledWord, iFormattedText);
[Visual Basic]
stateManager.SetNext(misspelledWord, iFormattedText)

Start the sample project. The sample document consists of main text, a header and a footer and some text frames. At the bottom, you can specify the different TextParts that should be included in the spell check process. Check or uncheck the check boxes and click on Spell Check Dialog. Only the checked TextParts are spell checked in the opened customizable SpellCheckDialog.


RichTextBox: Using a customizable SpellCheckDialog

Windows Forms User's Guide

TX Spell .NET enjoys a deep integration within the main word processing component. Integrating TX Spell .NET for Windows Forms into TX Text Control requires no code - it can be easily connected using the Visual Studio designer. To increase performance, the spelling dialog is opened by TX Text Control and not TX Spell .NET. But TX Spell .NET can be used with all kind of .NET Framework or third-party controls. This sample shows how to use TX Spell .NET with the .NET RichTextBox and customizable SpellCheckDialog.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 8.0.NET for Windows Forms\Samples\WinForms\CSharp\RichTextBox\SpellCheckDialog
  • %USERPROFILE%\My Documents\TX Spell 8.0.NET for Windows Forms\Samples\WinForms\VB.NET\RichTextBox\SpellCheckDialog

Using a customizable SpellCheckDialog

Principally, the integrated SpellCheckDialog of TX Spell .NET can be used with all types of input controls. If used in combination with TX Text Control, the handling is completely automated and no additional code is required. In order to use TX Spell .NET with any other control, the Proofing.TXSpellChecker.Check method must be called before the dialog is opened:

[C#]
txSpellChecker1.Check(richTextBox1.Text);
txSpellChecker1.SpellCheckDialog.Show();
[Visual Basic]
txSpellChecker1.Check(richTextBox1.Text)
txSpellChecker1.SpellCheckDialog.Show()

The dialog is automatically opened with the text of the RichTextBox. In the Proofing.TXSpellChecker.IncorrectWordChanging event, the misspelled word must be replaced in the connected control:

[C#]
private void txSpellChecker1_IncorrectWordChanging(object sender,
    TXTextControl.Proofing.IncorrectWordChangingEventArgs e)
{
    if (e.Type == TXTextControl.Proofing.TXSpell.ChangeType.Replace)
    {
        richTextBox1.SelectedText = e.CorrectedWord;
        return;
    }
    if (e.Type == TXTextControl.Proofing.TXSpell.ChangeType.Delete)
    {
        richTextBox1.Select(e.IncorrectWord.Start, e.IncorrectWord.Length);
        richTextBox1.SelectedText = "";
        return;
    }
}
[Visual Basic]
Private Sub txSpellChecker1_IncorrectWordChanging(sender As Object, _
    e As TXTextControl.Proofing.IncorrectWordChangingEventArgs)
    If e.Type = TXTextControl.Proofing.TXSpell.ChangeType.Replace Then
        richTextBox1.SelectedText = e.CorrectedWord
        Return
    End If
    If e.Type = TXTextControl.Proofing.TXSpell.ChangeType.Delete Then
        richTextBox1.[Select](e.IncorrectWord.Start, e.IncorrectWord.Length)
        richTextBox1.SelectedText = ""
        Return
    End If
End Sub

Start the sample application and click on Spell Check Dialog to start the checking process. The corrected words are replaced in the connected RichTextBox through the attached IncorrectWordChanging event.


RichTextBox: Using a customizable SpellCheckDialog with multiple RichTextBoxes

Windows Forms User's Guide

An unique advantage of TX Spell .NET is that a single instance of the spell check component can be used to provide spell checking capabilities to an unlimited number of controls.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\RichTextBox\SpellCheckDialog on multiple controls
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\RichTextBox\SpellCheckDialog on multiple controls

Using a customizable SpellCheckDialog with multiple RichTextBoxes

If a customizable SpellCheckDialog is used, the Proofing.TXSpellChecker.SpellCheckDialogClosing event can be used to link to another RichTextBox when the current control has been checked completely. This allows the usage of one instance of the dialog to spell check an unlimited number of RichTextBoxes.

[C#]
private void txSpellChecker1_SpellCheckDialogClosing(object sender,
    TXTextControl.Proofing.SpellCheckDialogClosingEventArgs e)
{
    curRichTextBox.Select(0, 0);
    if (e.StateManager.NextIncorrectWord != null)
    {
        return;
    }
    e.Cancel = SetNextTextControl(e.StateManager, curRichTextBox);
}
[Visual Basic]
Private Sub txSpellChecker1_SpellCheckDialogClosing(sender As Object, _
    e As TXTextControl.Proofing.SpellCheckDialogClosingEventArgs)
    curRichTextBox.[Select](0, 0)
    If e.StateManager.NextIncorrectWord IsNot Nothing Then
        Return
    End If
    e.Cancel = SetNextTextControl(e.StateManager, curRichTextBox)
End Sub

Start the sample application and click on the button Spell Check Dialog. One instance of the dialog checks each of the four RichTextBoxes.


RichTextBox: Using a custom spell check ContextMenu

Windows Forms User's Guide

When TX Spell .NET is connected to a TextControl through the SpellChecker property, TextControl provides a pre-defined spell check context menu that can be used to replace the misspelled word, open the SpellCheckDialog or to open the options user dialog. But sometimes, it is required to create a customizable context menu or to include the spell check menu items into an existing menu.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\RichTextBox\Context menu strip
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\RichTextBox\Context menu strip

Using the Check method

TX Spell .NET provides the GetMenuItems method that returns ready-to-use menu items that can be inserted into an existing ContextMenuStrip. The method accepts a misspelled word, the text of the RichTextBox instance and the maximum number of returned suggestions.

[C#]
TXTextControl.Proofing.MenuItem[] items = txSpellChecker1.GetMenuItems(currentIncorrectWord, richTextBox1.Text, 5);
[Visual Basic]
Dim items As TXTextControl.Proofing.MenuItem() = txSpellChecker1.GetMenuItems(currentIncorrectWord, richTextBox1.Text, 5)

TX Spell .NET provides different MenuItemTypes for different purposes such as deleting, ignoring or to add a word to a user dictionary.

Start the sample application and right-click on a misspelled word. You can replace the misspelled word with a correct suggestion, you can ignore it or you can add it to the user dictionary.


RichTextBox: Using TX Spell .NET with multiple RichTextBox instances

Windows Forms User's Guide

Integrating TX Spell .NET for Windows Forms with TX Text Control requires no code - it can be easily connected using the Visual Studio designer. To increase performance, the spelling dialog is opened by TX Text Control and not TX Spell .NET. The dialog that is opened by TX Text Control is pre-configured and can't be customized. Alternatively, you can open a fully customizable SpellCheckDialog from TX Spell .NET.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\RichTextBox\Multiple controls
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\RichTextBox\Multiple controls

Using TX Spell .NET with multiple RichTextBox instances

A high-performance spell checker requires a well-considered concept to work with multiple controls on a form in the same application. A single TX Spell .NET instance can be used with multiple instances of the RichTextBox. It is not necessary to have one instance of the spell checker for each instance of the RichTextBox, any other control of the .NET Framework or third-party control. This dramatically reduces the required memory and speeds up the spell checking process.

The concept of using multiple instances of the RichTextBox with the same instance of TX Spell .NET is very straightforward. It is not neccessary to switch manually between the controls. When text is changed in one of the RichTextBoxes, the Proofing.TXSpellChecker.Check method is called and the misspelled words are colorized:

[C#]
txSpellChecker1.Check(richTextBox.Text);
foreach (TXTextControl.Proofing.IncorrectWord incorrectWord in txSpellChecker1.IncorrectWords)
{
    if (incorrectWord.Start <= textPosition && textPosition <= incorrectWord.Start + incorrectWord.Length)
    {
        richTextBox.Select(incorrectWord.Start, incorrectWord.Length);
        richTextBox.SelectionColor = System.Drawing.Color.Red;
        richTextBox.SelectionLength = 0;
        richTextBox.SelectionStart = lastTextPosition;
        return;
    }
}
[Visual Basic]
txSpellChecker1.Check(richTextBox.Text)
For Each incorrectWord As TXTextControl.Proofing.IncorrectWord In txSpellChecker1.IncorrectWords
    If incorrectWord.Start <= textPosition AndAlso textPosition <= incorrectWord.Start + incorrectWord.Length Then
        richTextBox.[Select](incorrectWord.Start, incorrectWord.Length)
        richTextBox.SelectionColor = System.Drawing.Color.Red
        richTextBox.SelectionLength = 0
        richTextBox.SelectionStart = lastTextPosition
        Return
    End If
Next

Start the application and type text into each of the RichTextBoxes. Misspelled words are colorized in red automatically.


Using user dictionaries with TX Spell .NET

Windows Forms User's Guide

A user dictionary is a separate dictionary that can be used to add custom words such as brand names, trademarks or a specific vocabulary. TX Spell .NET uses plain text word lists as a user dictionary with the specific file extension *.txd. Using TX Spell .NET, an unlimited number of dictionaries and user dictionaries can be used at the same time. If a user dictionary is added to the DictionaryCollection, the Add to dictionary... button of the spell check dialog and the context menu is enabled. Where the spell check dialog and the user dictionary manager enable users to add and remove words manually, this sample shows how to use the API to access these user dictionaries.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\UserDictionary
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\UserDictionary

Creating a user dictionary

Adding and removing words from the user dictionary

Using the flags SET, WORDCHARS, BREAK and ICONV


Creating a user dictionary

Windows Forms User's Guide > Using user dictionaries with TX Spell .NET

The UserDictionary constructor can be used to load an existing user dictionary from a specific path or the default dictionary path. Using only the dictionary name without any path specifications, the corresponding dictionary file inside the default dictionary folder will be used. The name of the specified user dictionary file must end in ".txd". To create a new user dictionary, no constructor may be used. The following code shows how to create a new user dictionary and how to add some custom words to it:

[C#]
userDic = new TXTextControl.Proofing.UserDictionary();
txSpellChecker1.Dictionaries.Add(userDic);

userDic.Name = "User Dictionary";
userDic.AddWord("TXTextControl");
userDic.AddWord("TXSpell");
[Visual Basic]
userDic = New TXTextControl.Proofing.UserDictionary()
txSpellChecker1.Dictionaries.Add(userDic)

userDic.Name = "User Dictionary"
userDic.AddWord("TXTextControl")
userDic.AddWord("TXSpell")

Every Dictionary (OpenOfficeDictionary or UserDictionary) is enabled for spell checking and for creating suggestions by default. Therefore, the Dictionary.IsSpellCheckingEnabled and Dictionary.IsGetSuggestionsEnabled properties are set to true. To disable the usage of a specific dictionary, set the Dictionary.IsSpellCheckingEnabled to false.

>> Adding and removing words from the user dictionary


Adding and removing words from the user dictionary

Windows Forms User's Guide > Using user dictionaries with TX Spell .NET

In order to edit user dictionaries, the UserDictionary.IsEditable property must be set to true. This sample consists of a simple interface to add and remove words to and from the user dictionary. A ListBox is synchronized to show the content of the user dictionary. The following code is used to add a word to the user dictionary using the UserDictionary.AddWord method.

[C#]
userDic.AddWord(tbNewWord.Text);
[Visual Basic]
userDic.AddWord(tbNewWord.Text)

To remove a word from the user dictionary, the UserDictionary.RemoveWord method is used:

[C#]
userDic.RemoveWord(listBox1.Text);
[Visual Basic]
userDic.RemoveWord(listBox1.Text)

The following screenshot shows the interface of the sample application:


Using the flags SET, WORDCHARS, BREAK and ICONV

Windows Forms User's Guide > Using user dictionaries with TX Spell .NET

Both dictionaries of type OpenOfficeDictionary and UserDictionary support flags that provide specific settings to interpret the incoming string when spell checking text. For a user dictionary the flags SET, WORDCHARS, BREAK and ICONV are handled when defined at the beginning of the loaded user dictionary file or string array. When using these flags, they have to be defined as follows:

The SET flag represents the encoding that is used to load the user dictionary. Setting this flag is required to create a valid user dictionary file. To determine such an enconding, the user dictionary line must begin with SET, followed by a whitespace and ends with the encoding to be specified. Valid values are all encoding names that are supported by the .NET framework.

By default, each string that is matched by the regular expression \w+ is interpreted as a word. Additional characters can be defined by the WORDCHARS flag. That definition starts with WORDCHARS, followed by a whitespace and ends with a string that represents all additional characters.

To specify characters that are both word characters and delimiters, the BREAK flag can be used. Such a sequence of characters has to be set behind the BREAK flag, separated by a whitespace.

In some cases the text to spell check contains characters that are related but not equal to a character that is part of the dictionary's word list. To handle that character anyway, the ICONV flag can be specified. That flag is followed by two charcaters, where the first one represents the character that has to be replaced by the second character before spell checking a word.

As follows the beginning of a sample user dictionary is shown that includes all introduced flags:

The defined flags of that dictionary determines that its word list has to be loaded with the UTF-8 encoding (represented by the SET flag). Furthermore the characters '’-+.— are specified as additional word (WORDCHARS) and delimiter (BREAK) characters. The both ICONV flags determines that the character ’ has to be replaced by ' and the character — by - before spell checking a string. When spell checking the text That text doesn't include the hyphen—minus character '-'. with that dictionay, no incorrect words will be detected. Without determining the flags WORDCHARS, BREAK and ICONV, the strings doesn't, hyphen and minus are identified as misspelled words.

<< Adding and removing words from the user dictionary


Spell checking simple Windows Forms TextBoxes

Windows Forms User's Guide

TX Spell .NET can be used to spell check any text. It has been desigend to be effortlessly integrated into any kind of control. This article describes how to use TX Spell .NET with .NET TextBoxes in different ways.

The source code for all steps is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\Check simple text
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\Check simple text

Relevant API links:

  • Proofing.TXSpell.Check
  • Proofing.TXSpell.CreateSuggestions
  • Proofing.TXSpell.Suggestions
  • Proofing.TXSpell.IncorrectWords

The sample project consists of a form divided into 2 groups. Each group shows a different way of integrating spell checking into simple Windows Forms TextBoxes.

Group 1: Simple spell checking

Group 2: TextBox Validation


Group 1: Simple spell checking

Windows Forms User's Guide > Spell checking simple Windows Forms TextBoxes

The first group box consists of a TextBox and a Button. Type in some text and click the button to start the spell checking process.

The TXSpell.Check method is simply called with the text of the TextBox. The TXSpell.IncorrectWords collection retrieves all misspelled words. If the IncorrectWords.Count property returns more than 0, some words of the text are misspelled.

[C#]
txSpellChecker1.Check(tbDemo1.Text);

if (txSpellChecker1.IncorrectWords.Count > 0)
{
    tbDemo1.SelectAll();
    MessageBox.Show("The text box contains misspelled words.", "TX Spell .NET Demo", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
    MessageBox.Show("Spelling is correct.", "TX Spell .NET Demo", MessageBoxButtons.OK, MessageBoxIcon.Information);
[Visual Basic]
txSpellChecker1.Check(tbDemo1.Text)

If txSpellChecker1.IncorrectWords.Count > 0 Then
    tbDemo1.SelectAll()
    MessageBox.Show("The text box contains misspelled words.", "TX Spell .NET Demo", MessageBoxButtons.OK, MessageBoxIcon.[Error])
Else
    MessageBox.Show("Spelling is correct.", "TX Spell .NET Demo", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If

>> Group 2: TextBox Validation


Group 2: TextBox Validation

Windows Forms User's Guide > Spell checking simple Windows Forms TextBoxes

The second group box consists only of a TextBox and another Button. Typing some text into the TextBox and click on OK.

The result of this sample is very similar to the first group, but it uses the Validating and Validated events of the TextBox. The Validating event is fired everytime when the TextBox looses the focus. On this event, TX Spell .NET is used to check the text.

[C#]
private void tbDemo2_Validating(object sender, CancelEventArgs e)
{
    txSpellChecker1.Check(tbDemo2.Text);

    if (txSpellChecker1.IncorrectWords.Count > 0)
    {
        label3.Text = "Misspelled.";
        label3.ForeColor = Color.Red;
    }
}
[Visual Basic]
Private Sub tbDemo2_Validating(sender As Object, e As CancelEventArgs)
    txSpellChecker1.Check(tbDemo2.Text)

    If txSpellChecker1.IncorrectWords.Count > 0 Then
        label3.Text = "Misspelled."
        label3.ForeColor = Color.Red
    End If
End Sub

<< Group 1: Simple spell checking


Modify Spell Check Dialog

Windows Forms User's Guide

TX Spell .NET comes with a very flexible, dynamic and customizable spell check dialog. This dialog can be easily connected to a TXTextControl.TextControl or used with any other control that should be spell checked. The advantage of this dialog over the pre-defined dialog when used in combination with TX Text Control is that the functionality can be changed, buttons can be added or removed and you can change the overall behavior.

The source code for all steps is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\Modify SpellCheckDialog
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\Modify SpellCheckDialog

Modify Spell Check Dialog

The customizable SpellCheckDialog contains various button collections that can be used to add or remove buttons from the dialog. For example, the DialogButtonCollection collection allows you to remove the button to open the spell checking options dialog. Additionally, this collection can be used to add your own custom buttons with custom functionality. The following code shows how to change the text of the options button in the SpellCheckDialog:

[C#]
txSpellChecker1.SpellCheckDialog.OptionButtons[0].Text = checkBox1.Checked ? "My Options..." : "Options...";
[Visual Basic]
txSpellChecker1.SpellCheckDialog.OptionButtons(0).Text = If(checkBox1.Checked, "My Options...", "Options...")

Start the sample application in Visual Studio. A dialog is shown that can be used to customize the SpellCheckDialog. Use the checkboxes to enable a custom options dialog, to change the font of the dialog or to enable the Add To Dictionary Button.

Click on Spell Check Dialog to open the customized dialog. Close it and change some settings in order to open it again to see that the dialog reflects these changes.


Hyphenation with TX Spell .NET

Windows Forms User's Guide

TX Spell .NET provides different methods to hyphenate words in multilingual documents. It returns the hyphenation point before a specific divide position or an array of all hyphenation points for a defined word.

The source code for this sample is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\Hyphenation
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\Hyphenation

Relevant API links:

  • Proofing.TXSpell.HyphenationLanguage
  • Proofing.HyphenationList.HyphenateCapitalizedWords
  • Proofing.HyphenationList.MinCharsAtWordBegin
  • Proofing.HyphenationList.MinCharsAtWordEnd
  • Proofing.HyphenationListCollection.Item

Hyphenate words with TX Spell .NET

This sample uses the text of a TextBox as the input for TX Spell .NET to hyphenate a word. Additionally, it shows how to adjust typical settings such as the minimum number of characters at a word begin and word end.

Start the application and type in a word into the first TextBox. The bottom RichTextBox shows the hyphenated word immediately including the hyphenation positions.

The required code is straightforward. The text from the TextBox is used in the Proofing.TXSpell.GetHyphenationPoints method of TX Spell that returns the possible hyphenation points. For demo purposes, these points are used to split the word into separate syllables, which are concatenated with a hyphen to illustrate the potential hyphenation points.

[C#]
string sWordToHyphenate = textBox1.Text;
int[] iHyphenationPoints = txSpellChecker1.GetHyphenationPoints(sWordToHyphenate);

var parts = new List<string>(iHyphenationPoints.Length);

int index = 0;
foreach (int length in iHyphenationPoints)
{
    parts.Add(sWordToHyphenate.Substring(index, length - index));
    index = length;
}

foreach (string part in parts)
{
    richTextBox1.SelectionColor = Color.Blue;
    richTextBox1.SelectedText = part;
    richTextBox1.SelectedText = "-";
    richTextBox1.Select(richTextBox1.SelectionStart - 1, 1);
    richTextBox1.SelectionColor = Color.Red;
    richTextBox1.SelectionStart += 1;
}
[Visual Basic]
Dim sWordToHyphenate As String = TextBox1.Text
Dim iHyphenationPoints As Integer() = TxSpellChecker1.GetHyphenationPoints(sWordToHyphenate)

Dim parts = New List(Of String)(iHyphenationPoints.Length)

Dim index As Integer = 0
For Each length As Integer In iHyphenationPoints
    parts.Add(sWordToHyphenate.Substring(index, length - index))
    index = length
Next

For Each part As String In parts
    RichTextBox1.SelectionColor = Color.Blue
    RichTextBox1.SelectedText = part
    RichTextBox1.SelectedText = "-"
    RichTextBox1.[Select](RichTextBox1.SelectionStart - 1, 1)
    RichTextBox1.SelectionColor = Color.Red
    RichTextBox1.SelectionStart += 1
Next


SpellingCorrectionUIProvider: Creating a spelling correction user interface.

Windows Forms User's Guide

To provide a fully customized or integrated user interface, it is often required to build new dialogs and forms. With TX Spell's SpellingCorrectionUIProvider class, it is very simple to use data binding to achieve that goal without having to deal with events. Data binding in .NET serves the purpose to provide a simple and reliable way to interact with and display data and different states.

The following three articles give an insight into building custom spelling correction forms and dialogs by using the SpellingCorrectionUIProvider class which is provided by the TXSpellChecker.SpellingCorrectionUIProvider property.

The corresponding sample projects are contained in the following directories

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\SpellingCorrectionUIProvider
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\SpellingCorrectionUIProvider

Simple spelling correction user interface

Advanced spelling correction user interface

SpellCheckDialog by SpellingCorrectionUIProvider


Simple spelling correction user interface

Windows Forms User's Guide > SpellingCorrectionUIProvider: Creating a spelling correction user interface.

The sample project SpellingCorrectionUIProvider Simple shows how to set the suggestions in the System.Windows.Forms.ListBox automatically and the Enabled state for each System.Windows.Forms.Button without using additional code. Furthermore, it explains how to connect a TextControl to the SpellingCorrectionUIProvider and handle its misspelled words by using the Change, Delete and Ignore methods.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\SpellingCorrectionUIProvider\SpellingCorrectionUIProvider Simple
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\SpellingCorrectionUIProvider\SpellingCorrectionUIProvider Simple

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.StateManager.SetCurrent
  • Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect
  • Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.Suggestions
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Change
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Delete
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsDeleteEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Ignore
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreEnabled

There are 3 different places in the project that need to be handled:

1. The Form_Load event, where the SpellingCorrectionUIProvider class is connected to the TextControl and the data bindings are set for Buttons and the suggestion ListBox.

[C#]
private void Form1_Load(object sender, EventArgs e)
{
    ...
    // connect the TextControl to the TX Spell correction user interface manager
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.SetCurrent(textControl1);

    // automatically add suggestions for the current misspelled word to the ListBox and set its enabled state
    listBoxSuggestions.DataBindings.Add(new Binding("DataSource", txSpellChecker1.SpellingCorrectionUIProvider.SuggestionsHandling, "Suggestions"));
    listBoxSuggestions.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.SuggestionsHandling, "IsSuggestionListEnabled"));

    // adding data bindings for the 3 buttons "Change", "Delete" and "Ignore" to set their enabled state
    buttonChange.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsChangeEnabled"));
    buttonDelete.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsDeleteEnabled"));
    buttonIgnore.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsIgnoreEnabled"));
}
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs)

    ...

    ' connect the TextControl to the TX Spell correction user interface manager
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.SetCurrent(textControl1)

    ' automatically add suggestions for the current misspelled word to the ListBox and set its enabled state
    listBoxSuggestions.DataBindings.Add(New Binding("DataSource", txSpellChecker1.SpellingCorrectionUIProvider.SuggestionsHandling, "Suggestions"))
    listBoxSuggestions.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.SuggestionsHandling, "IsSuggestionListEnabled"));

    ' adding data bindings for the 3 buttons "Change", "Delete" and "Ignore" to set their enabled state
    buttonChange.DataBindings.Add(New Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsChangeEnabled"))
    buttonDelete.DataBindings.Add(New Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsDeleteEnabled"))
    buttonIgnore.DataBindings.Add(New Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsIgnoreEnabled"))
End Sub

2. The StateManaging_PropertyChanged event, that is attached in the Form_Load event and is used to detect whether a misspelled word is currently available or not.

[C#]
private void Form1_Load(object sender, EventArgs e)
{
    ...
    // attach an event to the property changed event
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.PropertyChanged +=new PropertyChangedEventHandler(StateManaging_PropertyChanged);
    ...
}

void StateManaging_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    // select the misspelled word in the TextControl
    if (e.PropertyName == "CurrentWordToCorrect")
    {
        if (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect != null)
        {
            ((TXTextControl.MisspelledWord)txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect).Select();
        }
        else {
            // if no misspelled word is available select nothing
            textControl1.Select(0, 0);
        }
    }
}
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs)
    ...
    ' attach an event to the property changed event
    AddHandler txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.PropertyChanged, AddressOf StateManaging_PropertyChanged
    ...
End Sub

Private Sub StateManaging_PropertyChanged(sender As Object, e As PropertyChangedEventArgs)
    ' select the misspelled word in the TextControl
    If e.PropertyName = "CurrentWordToCorrect" Then
        If txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect IsNot Nothing Then
            DirectCast(txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect, TXTextControl.MisspelledWord).[Select]()
        Else
            ' if no misspelled word is available select nothing
            textControl1.[Select](0, 0)
        End If
    End If
End Sub

3. Three Button_Clicked events for each of the Buttons. In each event, the corresponding method is called in the CorrectionHandler class for each Button to change, ignore or delete a misspelled word.

[C#]
private void buttonChange_Click(object sender, EventArgs e)
{
    // change the current misspelled word with the suggestion selected in the ListBox
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(listBoxSuggestions.Text);
}

private void buttonIgnore_Click(object sender, EventArgs e)
{
    // ignore the current misspelled word
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Ignore();
}

private void buttonDelete_Click(object sender, EventArgs e)
{
    // delete the current misspelled word
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Delete();
}
[Visual Basic]
Private Sub buttonChange_Click(sender As Object, e As EventArgs)
    ' change the current misspelled word with the suggestion selected in the ListBox
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(listBoxSuggestions.Text)
End Sub

Private Sub buttonIgnore_Click(sender As Object, e As EventArgs)
    ' ignore the current misspelled word
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Ignore()
End Sub

Private Sub buttonDelete_Click(sender As Object, e As EventArgs)
    ' delete the current misspelled word
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Delete()
End Sub

>> Advanced spelling correction user interface


Advanced spelling correction user interface

Windows Forms User's Guide > SpellingCorrectionUIProvider: Creating a spelling correction user interface.

Compared to SpellingCorrectionUIProvider Simple, four new features are added to the SpellingCorrectionUIProvider Advanced sample project:

  • Correcting all matches of the current misspelled word by using the ChangeAll, IgnoreAll and AddToDictionary methods
  • Selecting a dictionary to create suggestions
  • Displaying the sentence where the misspelled word is located
  • Setting a suggestion manually to correct the current misspelled word

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\CSharp\TextControl\SpellingCorrectionUIProvider\SpellingCorrectionUIProvider Advanced
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for Windows Forms\Samples\WinForms\VB.NET\TextControl\SpellingCorrectionUIProvider\SpellingCorrectionUIProvider Advanced

Correcting all matches of the current misspelled word by using the ChangeAll, IgnoreAll and AddToDicionary methods:

There are three new buttons to correct the current misspelled word and all its occurrences: The 'Change All', 'Ignore All' and 'Add To Dict.' button. As previously described in Simple spelling correction user interface, the Enabled states of these Buttons are also bound inside the Form_Load event and the corresponding methods are handled by the Button's Clicked events.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeAllEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreAllEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsAddToDictionaryEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.ChangeAll
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IgnoreAll
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.AddToDictionary
[C#]
private void Form1_Load(object sender, EventArgs e)
{
    ...
    buttonChangeAll.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsChangeAllEnabled"));
    buttonIgnoreAll.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsIgnoreAllEnabled"));
    buttonAddToDict.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsAddToDictionaryEnabled"));
}

private void buttonChangeAll_Click(object sender, EventArgs e)
{
    ...
    // change the current misspelled word and all accordances with the suggestion selected in the ListBox
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.ChangeAll(listBoxSuggestions.Text);
    ...
}

private void buttonIgnoreAll_Click(object sender, EventArgs e)
{
    // ignore the current misspelled word and all accordances
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.IgnoreAll();
}

private void buttonAddToDict_Click(object sender, EventArgs e)
{
    // add the current misspelled word to a user dictionary
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.AddToDictionary();
}
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs)
    ...
    ' connect the TextControl to the TX Spell correction user interface manager
    buttonChangeAll.DataBindings.Add(New Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsChangeAllEnabled"))
    buttonIgnoreAll.DataBindings.Add(New Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsIgnoreAllEnabled"))
    buttonAddToDict.DataBindings.Add(New Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsAddToDictionaryEnabled"))
End Sub

Private Sub buttonChangeAll_Click(sender As Object, e As EventArgs)
    ...
    ' change the current misspelled word and all accordances with the suggestion selected in the ListBox
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.ChangeAll(listBoxSuggestions.Text)
    ...
End Sub

Private Sub buttonIgnoreAll_Click(sender As Object, e As EventArgs)
     ' ignore the current misspelled word and all accordances
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.IgnoreAll()
End Sub

Private Sub buttonAddToDict_Click(sender As Object, e As EventArgs)
    ' add the current misspelled word to a user dictionary
     txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.AddToDictionary()
End Sub

Selecting a dictionary to create suggestions:

In some cases, it is necessary to use more than one dictionary to correct a text. To provide suggestions of one or more specific dictionaries, the user can set the corresponding dictionaries by using the properties of the SuggestionDictionariesHandler class. The recommended way to handle these kind of operations is first getting those dictionaries where the language matches the language of the current misspelled word by calling the SuggestionDictionariesHandler.SuggestionDictionaries property and then adding one or more of these dictionaries to the SuggestionDictionariesHandler.SelectedSuggestionDictionaries property. If this operation causes the creation of new suggestions and the SuggestionsHandler.Suggestions property is bound to a ListBox (see Simple spelling correction user interface), the property and the suggestion ListBox are updated automatically.

In this example, the available suggestion dictionaries are provided by a ComboBox where the DataSource property is bound to the SuggestionDictionariesHandler.SuggestionDictionaries property. Additionally, the ComboBox's Enabled state is bound to the SuggestionDictionariesHandler.IsSuggestionDictionariesEnabled property. If the user changes the selected suggestion dictionary, the corresponding SelectedIndexChanged event adds the new dictionary to the SuggestionDictionariesHandler.SelectedSuggestionDictionaries property.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.IsSuggestionDictionariesEnabled
  • Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SelectedSuggestionDictionaries
  • Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SuggestionDictionaries
[C#]
private void Form1_Load(object sender, EventArgs e)
{
    ...
    // adding data bindings to set the enabled state and automatically add the misspelled words's language depending suggestion dictionaries to the combo box
    comboBoxSuggestionDictionaries.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.SuggestionDictionariesHandling, "IsSuggestionDictionariesEnabled"));
    comboBoxSuggestionDictionaries.DataBindings.Add(new Binding("DataSource", txSpellChecker1.SpellingCorrectionUIProvider.SuggestionDictionariesHandling, "SuggestionDictionaries"));
}

private void comboBoxSuggestionDictionaries_SelectedIndexChanged(object sender, EventArgs e)
{
    // Sets the current suggestion dictionaries combo box's selected dictionary as selected dictionary to use for creating suggestions
    txSpellChecker1.SpellingCorrectionUIProvider.SuggestionDictionariesHandling.SelectedSuggestionDictionaries = new TXTextControl.Proofing.Dictionary[] { (TXTextControl.Proofing.Dictionary)comboBoxSuggestionDictionaries.SelectedItem };
}
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs)
    ...
    ' adding data bindings to set the enabled state and automatically add the misspelled words's language depending suggestion dictionaries to the combo box
    comboBoxSuggestionDictionaries.DataBindings.Add(New Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.SuggestionDictionariesHandling, "IsSuggestionDictionariesEnabled"))
    comboBoxSuggestionDictionaries.DataBindings.Add(New Binding("DataSource", txSpellChecker1.SpellingCorrectionUIProvider.SuggestionDictionariesHandling, "SuggestionDictionaries"))
End Sub

Private Sub comboBoxSuggestionDictionaries_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles comboBoxSuggestionDictionaries.SelectedIndexChanged
    ' Sets the current suggestion dictionaries combo box's selected dictionary as selected dictionary to use for creating suggestions
    txSpellChecker1.SpellingCorrectionUIProvider.SuggestionDictionariesHandling.SelectedSuggestionDictionaries = New TXTextControl.Proofing.Dictionary() {DirectCast(comboBoxSuggestionDictionaries.SelectedItem, TXTextControl.Proofing.Dictionary)}
End Sub

Displaying the sentence where the misspelled word is located:

Determining the sentence where the current misspelled word is located could be helpful to correct the word depending on its surrounding. For these cases the PreviewHandler.PreviewSentenceBounds property provides the index and the length of the misspelled word's sentence.

Applied to our example, the sentence extraction is handled by the Format event of the Binding object which connects a RichtTextBox.Text property with the PreviewHandler.PreviewSentenceBounds property. Consequently, on every PreviewSentenceBounds property change, the Format event is raised where finally the misspelled word's sentence text is determined and commited to the RichtTextBox.Text property.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.PreviewHandler.PreviewSentenceBounds
  • Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect
[C#]
private void Form1_Load(object sender, EventArgs e)
{
    ...
    // adding data binding for the richt text box to get the current misspelled word's sentence.
    Binding sentenceBinding = new Binding("Text", txSpellChecker1.SpellingCorrectionUIProvider.PreviewHandling, "PreviewSentenceBounds");
    sentenceBinding.Format += new ConvertEventHandler(sentenceBinding_Format);
    richTextBoxSentence.DataBindings.Add(sentenceBinding);
}

private void sentenceBinding_Format(object sender, ConvertEventArgs e)
{
    if (txSpellChecker1.SpellingCorrectionUIProvider.PreviewHandling.PreviewSentenceBounds != null)
    {
        e.Value = GetMisspelledWordSentence();
    }
    else
    {
        e.Value = "";
    }
}

private string GetMisspelledWordSentence()
{
    TXTextControl.IFormattedText iftCurrentTextPart = (TXTextControl.IFormattedText)txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentIFormattedText;
    TXTextControl.Paragraph pgMisspelledWordsParagraph = iftCurrentTextPart.Paragraphs.GetItem(((TXTextControl.MisspelledWord)txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect).Start);
    int[] riPreviewSentenceBounds = txSpellChecker1.SpellingCorrectionUIProvider.PreviewHandling.PreviewSentenceBounds;
    return pgMisspelledWordsParagraph.Text.Substring(riPreviewSentenceBounds[0] - (pgMisspelledWordsParagraph.Start - 1), riPreviewSentenceBounds[1]);
}
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs)
    ...
    ' adding data binding for the richt text box to get the current misspelled word's sentence.
    Dim sentenceBinding As New Binding("Text", txSpellChecker1.SpellingCorrectionUIProvider.PreviewHandling, "PreviewSentenceBounds")
    AddHandler sentenceBinding.Format, New ConvertEventHandler(AddressOf sentenceBinding_Format)
    richTextBoxSentence.DataBindings.Add(sentenceBinding)
End Sub

Private Sub sentenceBinding_Format(ByVal sender As Object, ByVal e As ConvertEventArgs)
    If txSpellChecker1.SpellingCorrectionUIProvider.PreviewHandling.PreviewSentenceBounds IsNot Nothing Then
         e.Value = GetMisspelledWordSentence()
    Else
        e.Value = ""
    End If
End Sub

Private Function GetMisspelledWordSentence() As String
    Dim iftCurrentTextPart As TXTextControl.IFormattedText = DirectCast(txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentIFormattedText, TXTextControl.IFormattedText)
    TXTextControl.Paragraph pgMisspelledWordsParagraph = iftCurrentTextPart.Paragraphs.GetItem(((TXTextControl.MisspelledWord)txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect).Start);
    Dim pgMisspelledWordsParagraph As TXTextControl.Paragraph = iftCurrentTextPart.Paragraphs.GetItem(DirectCast(txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect, TXTextControl.MisspelledWord).Start)
    Dim riPreviewSentenceBounds As Integer() = txSpellChecker1.SpellingCorrectionUIProvider.PreviewHandling.PreviewSentenceBounds
    Return pgMisspelledWordsParagraph.Text.Substring(riPreviewSentenceBounds(0) - (pgMisspelledWordsParagraph.Start - 1), riPreviewSentenceBounds(1))
End Sub

Setting a suggestion manually to correct the current misspelled word:

Sometimes, no suggestions can be created for a misspelled word. In this case, the user needs an interface to correct the word manually.

The SpellingCorrectionUIProvider Advanced sample project provides a TextBox to give the user the opportunity to edit the current misspelled word which is updated inside the box on every StateManager.CurrentWordToCorrect property change. The edited word is applied when the user clicks the 'Change' or 'Change All' button.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect
  • Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Change
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.ChangeAll
[C#]
private void Form1_Load(object sender, EventArgs e)
{
    ...
    // adding data binding for the text box to get the current misspelled word.
    Binding misspelledWordBinding = new Binding("Text", txSpellChecker1.SpellingCorrectionUIProvider.StateManaging, "CurrentWordToCorrect", true, DataSourceUpdateMode.Never);
    misspelledWordBinding.Format += new ConvertEventHandler(misspelledWordBinding_Format);
    textBoxEdit.DataBindings.Add(misspelledWordBinding);
}

private void misspelledWordBinding_Format(object sender, ConvertEventArgs e)
{
    if (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect != null)
    {
        e.Value = ((TXTextControl.MisspelledWord)txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect).Text;
        ...
    }
    else
    {
        e.Value = "";
        ...
    }
}
private void buttonChange_Click(object sender, EventArgs e)
{
    if (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing) {
    {
        // change the current misspelled word with the text box's text.
        txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(textBoxEdit.Text);
    }
    else
    {
        // change the current misspelled word with the suggestion selected in the ListBox
        txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(listBoxSuggestions.Text);
    }
}
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs)
    ...
    ' adding data binding for the text box to get the current misspelled word.
    Dim misspelledWordBinding As New Binding("Text", txSpellChecker1.SpellingCorrectionUIProvider.StateManaging, "CurrentWordToCorrect", True, DataSourceUpdateMode.Never)
    AddHandler misspelledWordBinding.Format, New ConvertEventHandler(AddressOf misspelledWordBinding_Format)
    textBoxEdit.DataBindings.Add(misspelledWordBinding)
End Sub

Private Sub misspelledWordBinding_Format(ByVal sender As Object, ByVal e As ConvertEventArgs)
    If txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect IsNot Nothing Then
         e.Value = DirectCast(txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect, TXTextControl.MisspelledWord).Text
        ...
    Else
        e.Value = ""
        ...
    End If
End Sub

Private Sub buttonChange_Click(ByVal sender As Object, ByVal e As EventArgs) Handles buttonChange.Click
    If txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing Then
        ' change the current misspelled word with the text box's text.
        txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(textBoxEdit.Text)
    Else
        ' change the current misspelled word with the suggestion selected in the ListBox
        txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(listBoxSuggestions.Text)
    End If
End Sub

Additionally, the TextBox's TextChanged event calls the CorrectionHandler.CheckCorrectedWord method to check whether the edited TextBox' text is correct or not.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.CheckCorrectedWord
  • Proofing.SpellingCorrectionUIProvider.StateManager.Mode
[C#]
private void textBoxEdit_TextChanged(object sender, EventArgs e)
{
    if (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.Mode != TXTextControl.Proofing.TXSpell.SpellingCorrectionMode.CorrectionCompleted)
    {
        string message;
        if (txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.CheckCorrectedWord(textBoxEdit.Text, out message))
        {
            // ... do something to show that the text box's text is correct
        }
        else
        {
            // ... do something to show that the text box's text is still incorrect
        }
    }
    else
    {
        // ... the spelling correction is completed. There is no text to check for correctness
    }
}
[Visual Basic]
Private Sub textBoxEdit_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles textBoxEdit.TextChanged
    If txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.Mode <> TXTextControl.Proofing.TXSpell.SpellingCorrectionMode.CorrectionCompleted Then
        Dim message As String = String.Empty
        If txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.CheckCorrectedWord(textBoxEdit.Text, message) Then
            ' ... do something to show that the text box's text is correct
        Else
            ' ... do something to show that the text box's text is still incorrect
        End If
    Else
        ' ... the spelling correction is completed. There is no text to check for correctness
    End If
End Sub

To inform the SpellingCorrectionUIProvider that the user is currently editing the word manually, the StateManager.IsWordToCorrectEditing property is set to true on the first editing operation. To leave the editing mode, the user can press the 'Undo Edit' button where the Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing property is set to false.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsUndoEditEnabled
  • Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing
  • Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect
[C#]
private void Form1_Load(object sender, EventArgs e)
{
    ...
    buttonUndoEdit.DataBindings.Add(new Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsUndoEditEnabled"));
}

private void textBoxEdit_KeyDown(object sender, KeyEventArgs e)
{
    // start word editing
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing = true;
}

private void buttonUndoEdit_Click(object sender, EventArgs e)
{
    // abort word editing
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing = false;
    textBoxEdit.Text = ((TXTextControl.MisspelledWord)txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect).Text;
    buttonIgnore.Focus();
}
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs)
    ...
    buttonUndoEdit.DataBindings.Add(New Binding("Enabled", txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling, "IsUndoEditEnabled"))
End Sub

Private Sub textBoxEdit_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles textBoxEdit.KeyDown
    ' start word editing
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing = True
End Sub

Private Sub buttonUndoEdit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles buttonUndoEdit.Click
    ' abort word editing
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing = False
    textBoxEdit.Text = DirectCast(txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect, TXTextControl.MisspelledWord).Text
    buttonIgnore.Focus()
End Sub


SpellCheckDialog by SpellingCorrectionUIProvider

Windows Forms User's Guide > SpellingCorrectionUIProvider: Creating a spelling correction user interface.

The sample project Custom SpellCheckDialog shows how to create a fully operational spell check dialog. Its functionality is completely based on the SpellingCorrectionUIProvider methods and properties that were introduced by the previous articles Simple spelling correction user interface and Advanced spelling correction user interface.

The major differences to these samples lie in connecting the TextControl before opening the dialog, handling a preview where to correct manually the current misspelled word, changing the functionality of a button depending on the StateManager.Mode and implementing a Button to open the OptionsDialog.

In the following, the underlying concepts behind these issues are described, but it won't give any further explanation in code details. Therefore, we ask you to explore the Custom SpellCheckDialog sample more closely by yourself.

Connecting the TextControl before opening the dialog

The principal task of a spell check dialog is to correct the current misspelled words one by one with a correction supporting user interface. But opening such a dialog makes only sense, if the TextControl actually contains misspelled words. To prevent an unnecessary initializing of the spell check dialog, the TextControl should be first connected with the SpellingCorrectionUIProvider to determine its mode. If it is set to SpellingCorrectionMode.NoWordsToCorrectFound, the dialog won't be opened and a MessageBox informs the user that the TextControl does not contain any misspelled words. Whether or not the dialog is shown, the SpellingCorrectionUIProvider should be reset to its initial state by using the StateManager.Cancel method.

Handling a preview

Most spell check dialogs provide a preview that gives the user an opportunity to correct the current misspelled word manually. Such an editor usually shows the sentence where the misspelled word is located and highlights it in red color. Additionally, on starting editing inside the preview, the rest of the dialog changes to an editing mode, where most buttons and controls are disabled and the 'Ignore' button is changed to an 'Undo Edit' button.

To implement this behavior, the SpellingCorrectionUIProvider provides the StateManager.IsWordToCorrectEditing property that changes the current mode to SpellingCorrectionMode.WordToCorrectEditing. In this case, bound Button's and Control's are disabled, except the 'Change' and 'Change All' buttons. However, in this example, the Clicked events of these two buttons won't commit the selected suggestion of the suggestion ListBox anymore, but the modified misspelled word from the preview editor as the change parameter. Furthermore, to give the user the chance to cancel misspelled word editing using the preview, the 'Ignore' button is changed to an 'Undo Edit' button, where its Clicked event sets the StateManager.IsWordToCorrectEditing to false. The preview itself is updated on every current misspelled word change or use of the 'Undo Edit' button.

Changing the functionality of a button

There are to cases where the functionality of a button can be changed. The first one, as described above, is when the 'Ignore' needs to be an 'Undo Edit' button. The other one is when the misspelled word is a duplicated word. In this case the 'Change' button becomes a 'Delete' button and its Clicked event calls the CorrectionHandler.Delete method instead the CorrectionHandler.Change method.

Open an OptionsDialog

In most spell check dialogs, the user can change some spelling settings, by opening an options dialog. To adopt any changes by these modifications, the connected TextControl must be spell checked again on closing the options dialog. The StateManager.IsOptionsSettings property supports that behavior: Before opening the options dialog, it must be set to true, to save any prior ignore operations. When the dialog is closed, the property is set to false, which leads to a spell check of the TextControl and a resetting of the stored, ignored words.

<< Advanced spelling correction user interface


WPF User's Guide

This guide describes how to create TX Spell .NET WPF applications with Visual Studio and shows how to use TX Spell .NET in combination with TX Text Control .NET for WPF.

Tutorial: Starting with Microsoft Visual Studio 2019 and TX Text Control

TX Text Control: Using a customizable SpellCheckDialog

TX Text Control: Using TX Spell .NET with multiple TX Text Control instances

TX Text Control: Using a custom spell check ContextMenu

TX Text Control: Using a customizable SpellCheckDialog with multiple TextControls

TX Text Control: Using a customizable SpellCheckDialog with different TextParts

RichTextBox: Using a customizable SpellCheckDialog

RichTextBox: Using a customizable SpellCheckDialog with multiple RichTextBoxes

RichTextBox: Using a custom spell check ContextMenu

RichTextBox: Using TX Spell .NET with multiple TX Text Control instances

Using user dictionaries with TX Spell .NET

Spell checking simple WPF TextBoxes

Hyphenation with TX Spell .NET

SpellingCorrectionUIProvider: Creating a spelling correction user interface.


Tutorial: Starting with Microsoft Visual Studio 2019 and TX Text Control

WPF User's Guide

TX Spell .NET is the perfect addition for TX Text Control to add professional, high-performance and reliable spell checking to your applications. Furthermore, combined with TX Text Control version 29.0, TX Spell .NET enables a fast way to hyphenate documents.

This getting started tutorial is the shortcut to use TX Spell .NET for WPF within Microsoft Visual Studio.

The source code for all steps is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\Simple
  • Samples\WPF\VB.NET\TextControl\Simple

Adding TX Text Control to the Window

Adding TX Spell .NET


Adding TX Text Control to the Window

WPF User's Guide > Tutorial: Starting with Microsoft Visual Studio 2019 and TX Text Control

1. Start Visual Studio and create a new project. Select either Visual Basic or C# as a project type, and WPF App (.NET Framework) as a template and click Next. In the following dialog, select a name and location and confirm with Create.

2. Find the TX Text Control 29.0 toolbox tab that has been created automatically. All usable TX Text Control controls or components are listed in this tab.

3. In the XAML view, replace the Grid with a DockPanel control as shown in the below screenshot:

4. Double-click the TextControl in the toolbox to add it to the Window. The XAML should look like this:

In the XAML, remove the Height and the Width properties for all added elements.

>> Adding TX Spell .NET


Adding TX Spell .NET

WPF User's Guide > Tutorial: Starting with Microsoft Visual Studio 2019 and TX Text Control

1. Select Add Reference... from the Project main menu. In the opened Reference Manager dialog box, click Browse and find the installation folder of TX Spell .NET for WPF. The default folder is located at:

C:\Program Files\Text Control GmbH\TX Spell 9.0 .NET for WPF\Assembly\

Select TXSpell.dll and TXSpell.WPF.dll from the Assembly folder and confirm with Add. Close the Reference Manager by clicking OK.

2. The TX Spell .NET namespace must be added to the Window XAML. Additionally, TX Spell .NET must be added as a resource to the Window. The complete XAML should look like this:

<Window x:Class="Simple.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525"
        xmlns:my="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
        xmlns:spell="clr-namespace:TXTextControl.WPF.Proofing;assembly=TXSpell.WPF">

    <Window.Resources>
        <spell:TXSpellChecker x:Key="txSpellChecker1"></spell:TXSpellChecker>
    </Window.Resources>

    <DockPanel>
        <my:TextControl
            Name="textControl1"
            IsSpellCheckingEnabled="True"
            IsHyphenationEnabled="True"
            SpellChecker="txSpellChecker1" />
    </DockPanel>
</Window>

3. The SpellChecker property of TextControl must be set with the key name of the created TXSpellChecker instance. Add the property to the TextControl element in the XAML as shown in the code above.

4. Additionally, the IsSpellCheckingEnabled property of TextControl must be set to true.

5. To enable hyphenation, set the IsHyphenationEnabled property of TextControl to true.

6. Open the licenses.licx file, which is located in the Properties folder (C#) or the My Project folder (VB.NET).

Add the following entry:

TXTextControl.WPF.Proofing.TXSpellChecker, TXSpell.WPF

Build and start the application to see the first results. The spell-as-you-type functionality and the English dictionary is enabled by default. Misspelled words are underlined automatically and can be corrected by using the shipped right-click context menu. Using this menu, you can open the integrated dialog box as well. In addition, on reaching the end of a line, the last word is hyphenated by using the corresponding English hyphenation list.

<< Adding TX Text Control to the Window


TX Text Control: Using a customizable SpellCheckDialog

WPF User's Guide

When TX Spell .NET is connected to an instance of TextControl, a context menu and a pre-configured SpellCheckDialog is provided automatically. This SpellCheckDialog is opened by TX Text Control and cannot be customized. In order to customize the dialog box, the SpellCheckDialog from TX Spell .NET can be used.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\SpellCheckDialog
  • Samples\WPF\VB.NET\TextControl\SpellCheckDialog

Using a customizable SpellCheckDialog

Principally, the integrated SpellCheckDialog of TX Spell .NET can be used with all types of input controls. If used in combination with TX Text Control, the handling is completely automated and no additional code is required. The SpellCheckDialog method can be easily called with a TextControl instance given in the constructor as a parameter:

[C#]
txSpellChecker1.SpellCheckDialog.Show(textControl1);
[Visual Basic]
txSpellChecker1.SpellCheckDialog.Show(textControl1)

After starting the sample program, simply click on the Spell Check Dialog... button to open the fully customizable user dialog box.


TX Text Control: Using TX Spell .NET with multiple TX Text Control instances

WPF User's Guide

A high-performance spell checker requires a well-considered concept to work with multiple controls on a form in the same application. A single TX Spell .NET instance can be used with multiple instances of TextControl. It is not necessary to have one instance of the spell checker for each instance of TextControl. This dramatically reduces the required memory and speeds up the spell checking process.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\Multiple controls
  • Samples\WPF\VB.NET\TextControl\Multiple controls

Using TX Spell .NET with multiple TX Text Control instances

The concept of using multiple instances of TextControl with the same instance of TX Spell .NET is very straightforward. It is not neccessary to switch manually between the controls. Different from other spell checker components, the connection between the consuming control and TX Spell .NET is set with TextControl. TX Text Control searches for the TXSpellChecker instances in every resource part of the application.

To connect TX Spell .NET with the TextControl, the SpellChecker property of each TextControl must be connected to the same TX Spell .NET instance:

After starting the application, each connected TextControl uses the same TX Spell .NET instance and therefore the same resources, dictionaries and user dictionaries.


TX Text Control: Using a custom spell check ContextMenu

WPF User's Guide

When TX Spell .NET is connected to a TextControl through the SpellChecker property, TextControl provides a pre-defined spell check context menu that can be used to replace the misspelled word, open the SpellCheckDialog or to open the options user dialog. But sometimes, it is required to create a customizable context menu or to include the spell check menu items into an existing menu.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\Context menu strip
  • Samples\WPF\VB.NET\TextControl\Context menu strip

Using a custom spell check ContextMenu

TX Spell .NET provides the GetMenuItems method that returns ready-to-use menu items that can be inserted into an existing ContextMenuStrip. The method accepts a misspelled word, the connected TextControl instance and the maximum number of returned suggestions.

[C#]
TXTextControl.WPF.Proofing.MenuItem[] items = txSpellChecker1.GetMenuItems(misspelledWord, textControl1, 5);
[Visual Basic]
Dim items As TXTextControl.WPF.Proofing.MenuItem() = txSpellChecker1.GetMenuItems(misspelledWord, textControl1, 5)

TX Spell .NET provides different MenuItemTypes for different purposes such as deleting, ignoring or to add a word to a user dictionary.

Start the sample application and right-click on a misspelled word (red zig-zag line). You can replace the misspelled word with a correct suggestion, you can ignore it or you can add it to the user dictionary.


TX Text Control: Using a customizable SpellCheckDialog with multiple TextControls

WPF User's Guide

An unique advantage of TX Spell .NET is that a single instance of the spell check component can be used to provide spell checking capabilities to an unlimited number of controls. To enable spell checking for a TextControl, the SpellChecker property of TextControl must be simply set to the specific TXSpellChecker instance.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\SpellCheckDialog on multiple controls
  • Samples\WPF\VB.NET\TextControl\SpellCheckDialog on multiple controls

Using a customizable SpellCheckDialog with multiple TextControls

If a customizable SpellCheckDialog is used, the WPF.Proofing.TXSpellChecker.SpellCheckDialogClosing event can be used to link to another TextControl when the current control has been checked completely. This allows the usage of one instance of the dialog to spell check an unlimited number of TextControls.

[C#]
private void txSpellChecker1_SpellCheckDialogClosing(object sender,
    TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs e) {
    if (e.StateManager.NextMisspelledWord != null) {
        return;
    }
    e.Cancel = SetNextTextControl(e.StateManager, curTextControl);
}
[Visual Basic]
Private Sub txSpellChecker1_SpellCheckDialogClosing(sender As Object, _
    e As TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs)
    If e.StateManager.NextMisspelledWord IsNot Nothing Then
        Return
    End If
    e.Cancel = SetNextTextControl(e.StateManager, curTextControl)
End Sub

Start the sample application and click on the button Spell Check Dialog. The dialog checks each of the four TextControls and every contained TextPart such as headers, footers or text frames.


TX Text Control: Using a customizable SpellCheckDialog with different TextParts

WPF User's Guide

The customizable SpellCheckDialog is very flexible and can be used in many different ways. Consider a situation where only specific TextParts such as headers and footers or specific text frames should be spell checked or ignored during the checking process.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\SpellCheckDialog on specific text parts
  • Samples\WPF\VB.NET\TextControl\SpellCheckDialog on specific text parts

Using a customizable SpellCheckDialog with different TextParts

The SpellCheckDialogStateManager class provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog. In this sample, an overload is used that provides the possibility to indicate a specific TextPart to spell check.

[C#]
stateManager.SetNext(misspelledWord, iFormattedText);
[Visual Basic]
stateManager.SetNext(misspelledWord, iFormattedText)

Start the sample project. The sample document consists of main text, a header and a footer and some text frames. At the bottom, you can specify the different TextParts that should be included in the spell check process. Check or uncheck the check boxes and click on Spell Check Dialog. Only the checked TextParts are spell checked in the opened customizable SpellCheckDialog.


RichTextBox: Using a customizable SpellCheckDialog

WPF User's Guide

TX Spell .NET enjoys a deep integration within the main word processing component. Integrating TX Spell .NET for Windows Forms into TX Text Control requires no code - it can be easily connected using the Visual Studio designer. To increase performance, the spelling dialog is opened by TX Text Control and not TX Spell .NET. But TX Spell .NET can be used with all kind of .NET Framework or third-party controls. This sample shows how to use TX Spell .NET with the .NET RichTextBox and customizable SpellCheckDialog.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\RichTextBox\SpellCheckDialog
  • Samples\WPF\VB.NET\RichTextBox\SpellCheckDialog

Using a customizable SpellCheckDialog

Principally, the integrated SpellCheckDialog of TX Spell .NET can be used with all types of input controls. If used in combination with TX Text Control, the handling is completely automated and no additional code is required. In order to use TX Spell .NET with any other control, the WPF.Proofing.TXSpellChecker.Check method must be called before the dialog is opened:

[C#]
txSpellChecker1.Check(new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text);
txSpellChecker1.SpellCheckDialog.Show(this);
[Visual Basic]
txSpellChecker1.Check(New TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text)
txSpellChecker1.SpellCheckDialog.Show(Me)

The dialog is automatically opened with the text of the RichTextBox. In the WPF.Proofing.TXSpellChecker.IncorrectWordChanging event, the misspelled word must be replaced in the connected control:

[C#]
void txSpellChecker1_IncorrectWordChanging(object sender, TXTextControl.Proofing.IncorrectWordChangingEventArgs e)
{
    if (e.Type != TXTextControl.Proofing.TXSpell.ChangeType.Ignore)
    {
        TextRange range = GetTextRangeInDocument(e.IncorrectWord.Start, e.IncorrectWord.Start + e.IncorrectWord.Length, new
TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd));

        if (e.Type == TXTextControl.Proofing.TXSpell.ChangeType.Replace)
        {
            range.Text = e.CorrectedWord;
        }
        else
        {
            if (e.Type == TXTextControl.Proofing.TXSpell.ChangeType.Delete)
            {
                range.Text = "";
            }
        }
    }
}
[Visual Basic]
Private Sub txSpellChecker1_IncorrectWordChanging(sender As Object, e As TXTextControl.Proofing.IncorrectWordChangingEventArgs)
    If e.Type <> TXTextControl.Proofing.TXSpell.ChangeType.Ignore Then
        Dim range As TextRange = GetTextRangeInDocument(e.IncorrectWord.Start, e.IncorrectWord.Start + e.IncorrectWord.Length, New
TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd))

        If e.Type = TXTextControl.Proofing.TXSpell.ChangeType.Replace Then
            range.Text = e.CorrectedWord
        Else
            If e.Type = TXTextControl.Proofing.TXSpell.ChangeType.Delete Then
                range.Text = ""
            End If
        End If
    End If
End Sub

Start the sample application and click on Spell Check Dialog to start the checking process. The corrected words are replaced in the connected RichTextBox through the attached IncorrectWordChanging event.


RichTextBox: Using a customizable SpellCheckDialog with multiple RichTextBoxes

WPF User's Guide

An unique advantage of TX Spell .NET is that a single instance of the spell check component can be used to provide spell checking capabilities to an unlimited number of controls.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\SpellCheckDialog on multiple controls
  • Samples\WPF\VB.NET\SpellCheckDialog on multiple controls

Using a customizable SpellCheckDialog with multiple RichTextBoxes

If a customizable SpellCheckDialog is used, the WPF.Proofing.TXSpellChecker.SpellCheckDialogClosing event can be used to link to another RichTextBox when the current control has been checked completely. This allows the usage of one instance of the dialog to spell check an unlimited number of RichTextBoxes.

[C#]
private void txSpellChecker1_SpellCheckDialogClosing(object sender,
    TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs e)
{
    if (e.StateManager.NextIncorrectWord != null)
    {
        return;
    }
    e.Cancel = SetNextControl(e.StateManager, curControl);
}
[Visual Basic]
Private Sub txSpellChecker1_SpellCheckDialogClosing(sender As Object, _
    e As TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs)
    If e.StateManager.NextIncorrectWord IsNot Nothing Then
        Return
    End If
    e.Cancel = SetNextControl(e.StateManager, curControl)
End Sub

Start the sample application and click on the button Spell Check Dialog. One instance of the dialog checks each of the four RichTextBoxes.


RichTextBox: Using a custom spell check ContextMenu

WPF User's Guide

When TX Spell .NET is connected to a TextControl through the SpellChecker property, TextControl provides a pre-defined spell check context menu that can be used to replace the misspelled word, open the SpellCheckDialog or to open the options user dialog. But sometimes, it is required to create a customizable context menu or to include the spell check menu items into an existing menu.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\RichTextBox\Context menu strip
  • Samples\WPF\VB.NET\RichTextBox\Context menu strip

Using the Check method

TX Spell .NET provides the GetMenuItems method that returns ready-to-use menu items that can be inserted into an existing ContextMenuStrip. The method accepts a misspelled word, the text of the RichTextBox instance and the maximum number of returned suggestions.

[C#]
TXTextControl.WPF.Proofing.MenuItem[] items = txSpellChecker1.GetMenuItems(
    currentIncorrectWord,
    new TextRange(richTextBox1.Document.ContentStart,
    richTextBox1.Document.ContentEnd).Text, 5);
[Visual Basic]
Dim items As TXTextControl.WPF.Proofing.MenuItem() = txSpellChecker1.GetMenuItems( _
    currentIncorrectWord, _
    New TextRange(richTextBox1.Document.ContentStart, _
    richTextBox1.Document.ContentEnd).Text, 5)

TX Spell .NET provides different MenuItemTypes for different purposes such as deleting, ignoring or to add a word to a user dictionary.

Start the sample application and right-click on a misspelled word. You can replace the misspelled word with a correct suggestion, you can ignore it or you can add it to the user dictionary.


RichTextBox: Using TX Spell .NET with multiple TX Text Control instances

WPF User's Guide

Integrating TX Spell .NET for Windows Forms into TX Text Control requires no code - it can be easily connected using the Visual Studio designer. To increase performance, the spelling dialog is opened by TX Text Control and not TX Spell .NET. The dialog that is opened by TX Text Control is pre-configured and can't be customized. Alternatively, you can call a fully customizable SpellCheckDialog from TX Spell .NET.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\Multiple controls
  • Samples\WPF\VB.NET\TextControl\Multiple controls

Using TX Spell .NET with multiple RichTextBox instances

A high-performance spell checker requires a well-considered concept to work with multiple controls on a form in the same application. A single TX Spell .NET instance can be used with multiple instances of the RichTextBox. It is not necessary to have one instance of the spell checker, for each instance of the RichTextBox or any other control of the Framework or third-party control. This dramatically reduces the required memory and speeds up the spell checking process.

The concept of using multiple instances of the RichTextBox with the same instance of TX Spell .NET is very straightforward. It is not neccessary to switch manually between the controls. When text is changed in one of the RichTextBoxes, the WPF.Proofing.TXSpellChecker.Check method is called and the misspelled words are colorized:

[C#]
TextRange range = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd);
txSpellChecker1.Check(range.Text);
int textPosition = GetTextPosition(currentPosition, richTextBox);
if (textPosition != -1)
{
    foreach (TXTextControl.Proofing.IncorrectWord incorrectWord in txSpellChecker1.IncorrectWords)
    {
        if (incorrectWord.Start <= textPosition && textPosition <= incorrectWord.Start + incorrectWord.Length)
        {
            ColorizeIncorrectWord(incorrectWord, richTextBox);
            return;
        }
    }

    TextRange word = GetWordAtPosition(textPosition, richTextBox);
    if (word != null)
    {
        word.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Black);
    }
}
[Visual Basic]
Dim range As New TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd)
txSpellChecker1.Check(range.Text)
Dim textPosition As Integer = GetTextPosition(currentPosition, richTextBox)
If textPosition <> -1 Then
    For Each incorrectWord As TXTextControl.Proofing.IncorrectWord In txSpellChecker1.IncorrectWords
        If incorrectWord.Start <= textPosition AndAlso textPosition <= incorrectWord.Start + incorrectWord.Length Then
            ColorizeIncorrectWord(incorrectWord, richTextBox)
            Return
        End If
    Next

    Dim word As TextRange = GetWordAtPosition(textPosition, richTextBox)
    If word IsNot Nothing Then
        word.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Black)
    End If
End If

Start the application and type in text into each of the RichTextBoxes. Misspelled words are colorized in red automatically.


Using user dictionaries with TX Spell .NET

WPF User's Guide

A user dictionary is a separate dictionary that can be used to add custom words such as brand names, trademarks or a specific vocabulary. TX Spell .NET uses plain text word lists as a user dictionary with the specific file extension *.txd. Using TX Spell .NET, an unlimited number of dictionaries and user dictionaries can be used at the same time. If a user dictionary is added to the DictionaryCollection, the Add to dictionary... button of the spell check dialog and the context menu is enabled. Where the spell check dialog and the user dictionary manager enable users to add and remove words manually, this sample shows how to use the API to access these user dictionaries.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\UserDictionary
  • Samples\WPF\VB.NET\UserDictionary

Creating a user dictionary

Adding and removing words from the user dictionary


Creating a user dictionary

WPF User's Guide > Using user dictionaries with TX Spell .NET

The UserDictionary constructor can be used to load an existing user dictionary from a specific path or the default dictionary path. Using only the dictionary name without any path specifications, the corresponding dictionary file inside the default dictionary folder will be used. The name of the specified user dictionary file must end in ".txd". To create a new user dictionary, no constructor may be used. The following code shows how to create a new user dictionary and how to add some custom words to it:

[C#]
userDic = new TXTextControl.Proofing.UserDictionary();
txSpellChecker1.Dictionaries.Add(userDic);

userDic.Name = "User Dictionary";
userDic.AddWord("TXTextControl");
userDic.AddWord("TXSpell");
[Visual Basic]
userDic = New TXTextControl.Proofing.UserDictionary()
txSpellChecker1.Dictionaries.Add(userDic)

userDic.Name = "User Dictionary"
userDic.AddWord("TXTextControl")
userDic.AddWord("TXSpell")

Every Dictionary (OpenOfficeDictionary or UserDictionary) is enabled for spell checking and for creating suggestions by default. Therefore, the Dictionary.IsSpellCheckingEnabled and Dictionary.IsGetSuggestionsEnabled properties are set to true. To disable the usage of a specific dictionary, set the Dictionary.IsSpellCheckingEnabled to false.

>> Adding and removing words from the user dictionary


Adding and removing words from the user dictionary

WPF User's Guide > Using user dictionaries with TX Spell .NET

In order to edit user dictionaries, the UserDictionary.IsEditable property must be set to true. This sample consists of a simple interface to add and remove words to and from the user dictionary. A ListBox is synchronized to show the content of the user dictionary. The following code is used to add a word to the user dictionary using the UserDictionary.AddWord method.

[C#]
userDic.AddWord(tbNewWord.Text);
[Visual Basic]
userDic.AddWord(tbNewWord.Text)

To remove a word from the user dictionary, the UserDictionary.RemoveWord method is used:

[C#]
userDic.RemoveWord(lbCustomWords.SelectedValue.ToString());
[Visual Basic]
userDic.RemoveWord(lbCustomWords.SelectedValue.ToString())

The following screenshot shows the interface of the sample application:

<< Creating a user dictionary


Spell checking simple WPF TextBoxes

WPF User's Guide

TX Spell .NET can be used to spell check any text. It has been designed to be effortlessly integrated into any kind of control. This article describes how to use TX Spell .NET with .NET TextBoxes in different ways.

The source code for all steps is contained in the following directories:

  • Samples\WPF\CSharp\Check simple text
  • Samples\WPF\VB.NET\Check simple text

Relevant API links:

  • Proofing.TXSpell.Check
  • Proofing.TXSpell.CreateSuggestions
  • Proofing.TXSpell.Suggestions
  • Proofing.TXSpell.IncorrectWords

The sample project consists of a form divided into 2 groups. Each group shows a different way of integrating spell checking into simple WPF TextBoxes.

Group 1: Simple spell checking

Group 2: TextBox Validation


Group 1: Simple spell checking

WPF User's Guide > Spell checking simple WPF TextBoxes

The first group box consists of a simple TextBox and a Button. Type in some text and click the button to start the spell checking process.

The TXSpell.Check method is simply called with the text of the TextBox. The TXSpell.IncorrectWords collection retrieves all misspelled words. If the IncorrectWords.Count property returns more than 0, some words of the text are misspelled.

[C#]
txSpellChecker1.Check(tbDemo1.Text);

if (txSpellChecker1.IncorrectWords.Count > 0)
{
    tbDemo1.SelectAll();
    MessageBox.Show("The text box contains misspelled words.",
        "TX Spell .NET Demo",
        MessageBoxButton.OK,
        MessageBoxImage.Error);
}
else
    MessageBox.Show("Spelling is correct.",
        "TX Spell .NET Demo",
        MessageBoxButton.OK,
        MessageBoxImage.Information);
[Visual Basic]
txSpellChecker1.Check(tbDemo1.Text)

If txSpellChecker1.IncorrectWords.Count > 0 Then
    tbDemo1.SelectAll()
    MessageBox.Show("The text box contains misspelled words.", "TX Spell .NET Demo", MessageBoxButton.OK, MessageBoxImage.[Error])
Else
    MessageBox.Show("Spelling is correct.", "TX Spell .NET Demo", MessageBoxButton.OK, MessageBoxImage.Information)
End If

>> Group 2: TextBox Validation


Group 2: TextBox Validation

WPF User's Guide > Spell checking simple WPF TextBoxes

The second group box consists only of a TextBox. Type some text into the TextBox to start the validation process. TX Spell .NET is used to validate the text by checking the spelling.

The result of this sample is very similar to the first group, but it uses a ValidationRule that uses TX Spell .NET to validate the spelling. It returns false, if the spelling is not correct. The text box is validated everytime the TextBox content is changed.

[C#]
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
    TXSpell.Check((string)value);

    if (TXSpell.IncorrectWords.Count > 0)
    {
        return new ValidationResult(false, "Misspelled.");
    }

    return new ValidationResult(true, null);
}
[Visual Basic]
Public Overrides Function Validate(ByVal value As Object, _
    ByVal cultureInfo As Globalization.CultureInfo) As ValidationResult
    TXSpell.Check(DirectCast(value, String))

    If TXSpell.IncorrectWords.Count > 0 Then
        Return New ValidationResult(False, "Misspelled.")
    End If

    Return New ValidationResult(True, Nothing)
End Function

The validation rule is added to the TextBox using a binding path in the XAML view:

<TextBox x:Name="Box" Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}" Margin="9,40,12,58" Height="23">
    <TextBox.Text>
        <Binding Path="ValueInBox" UpdateSourceTrigger="PropertyChanged">
            <Binding.ValidationRules>
                <CheckSimpleText:SpellingRule x:Name="spellingRule1"></CheckSimpleText:SpellingRule>
            </Binding.ValidationRules>
        </Binding>
    </TextBox.Text>
</TextBox>

<< Group 1: Simple spell checking


Hyphenation with TX Spell .NET

WPF User's Guide

TX Spell .NET provides different methods to hyphenate words in multilingual documents. It returns the hyphenation point before a specific divide position or an array of all hyphenation points for a defined word.

The source code for this sample is contained in the following directories:

  • Samples\WPF\CSharp\Hyphenation
  • Samples\WPF\VB.NET\Hyphenation

Relevant API links:

  • Proofing.TXSpell.HyphenationLanguage
  • Proofing.HyphenationList.HyphenateCapitalizedWords
  • Proofing.HyphenationList.MinCharsAtWordBegin
  • Proofing.HyphenationList.MinCharsAtWordEnd
  • Proofing.HyphenationListCollection.Item

Hyphenate words with TX Spell .NET

This sample uses the text of a TextBox as the input for TX Spell .NET to hyphenate a word. Additionally, it shows how to adjust typical settings such as the minimum number of characters at a word begin and word end.

Start the application and type in a word into the first TextBox. The bottom RichTextBox shows the hyphenated word immediately including the hyphenation positions.

The required code is straightforward. The text from the TextBox is used in the Proofing.TXSpell.GetHyphenationPoints method of TX Spell that returns the possible hyphenation points. For demo purposes, these points are used to split the word into separate syllables, which are concatenated with a hyphen to illustrate the potential hyphenation points.

[C#]
string sWordToHyphenate = textBox1.Text;
int[] iHyphenationPoints = txSpellChecker1.GetHyphenationPoints(sWordToHyphenate);

var parts = new List<string>(iHyphenationPoints.Length);

int index = 0;
foreach (int length in iHyphenationPoints)
{
    parts.Add(sWordToHyphenate.Substring(index, length - index));
    index = length;
}

string sHyphenatedString = "";

foreach (string part in parts)
    sHyphenatedString += part + "-";

richTextBox1.Selection.Text = sHyphenatedString;
[Visual Basic]
Dim sWordToHyphenate As String = textBox1.Text
Dim iHyphenationPoints As Integer() = txSpellChecker1.GetHyphenationPoints(sWordToHyphenate)

Dim parts = New List(Of String)(iHyphenationPoints.Length)

Dim index As Integer = 0
For Each length As Integer In iHyphenationPoints
    parts.Add(sWordToHyphenate.Substring(index, length - index))
    index = length
Next

Dim sHyphenatedString As String = ""

For Each part As String In parts
    sHyphenatedString += part & "-"
Next

richTextBox1.Selection.Text = sHyphenatedString


SpellingCorrectionUIProvider: Creating a spelling correction user interface.

WPF User's Guide

To provide a fully customized or integrated user interface, it is often required to build new dialogs and forms. With TX Spell's SpellingCorrectionUIProvider class, it is very simple to use data binding to achieve that goal without having to deal with events. Data binding in .NET serves the purpose to provide a simple and reliable way to interact with and display data and different states.

The following three articles give an insight into building custom spelling correction forms and dialogs by using the SpellingCorrectionUIProvider class which is provided by the TXSpellChecker.SpellingCorrectionUIProvider property.

The corresponding sample projects are contained in the following directories

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for WPF\Samples\WPF\CSharp\TextControl\SpellingCorrectionUIProvider
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for WPF\Samples\WPF\VB.NET\TextControl\SpellingCorrectionUIProvider

Simple spelling correction user interface

Advanced spelling correction user interface

SpellCheckDialog by SpellingCorrectionUIProvider


Simple spelling correction user interface

WPF User's Guide > SpellingCorrectionUIProvider: Creating a spelling correction user interface.

The sample project SpellingCorrectionUIProvider Simple shows how to set the suggestions in the System.Windows.Controls.ListBox automatically and the IsEnabled state for each System.Windows.Controls.Button without using additional code. Furthermore, it explains how to connect a TextControl to the SpellingCorrectionUIProvider and handle its misspelled words by using the Change, Delete and Ignore methods.

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for WPF\Samples\WPF\CSharp\TextControl\SpellingCorrectionUIProvider\SpellingCorrectionUIProvider Simple
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for WPF\Samples\WPF\VB.NET\TextControl\SpellingCorrectionUIProvider\SpellingCorrectionUIProvider Simple

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.StateManager.SetCurrent
  • Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect
  • Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.Suggestions
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Change
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Delete
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsDeleteEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Ignore
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreEnabled

There are 2 different places in the project that need to be handled:

1. The XAML code, where the IsEnabled bindings are set for Buttons and the suggestion ListBox. Additionally, the ListBox's content is updated by an ItemsSource binding with the SuggestionsHandler.Suggestions property and each Button gets a Click event to force the corresponding method.

<ListBox Name="listBoxSuggestions" Grid.Column="1" Margin="7"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1},Path=SpellingCorrectionUIProvider.SuggestionsHandling.IsSuggestionListEnabled}"
    ItemsSource ="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.SuggestionsHandling.Suggestions}">
</ListBox>

<Button Name="buttonChange" VerticalAlignment="Top" Margin="7" Content="Change"
    Click="buttonChange_Click"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.CorrectionHandling.IsChangeEnabled}">
</Button>

<Button Name="buttonIgnore" VerticalAlignment="Top" Grid.Column="1" Margin="7" Content="Ignore"
    Click="buttonIgnore_Click"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.CorrectionHandling.IsIgnoreEnabled}">
</Button>

<Button Name="buttonDelete" VerticalAlignment="Top" Grid.Column="2" Margin="7" Content="Delete"
    Click="buttonDelete_Click"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.CorrectionHandling.IsDeleteEnabled}">
</Button>

[C#]
private void buttonChange_Click(object sender, RoutedEventArgs e)
{
    // change the current misspelled word with the suggestion selected in the ListBox
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(listBoxSuggestions.SelectedItem.ToString());
}

private void buttonIgnore_Click(object sender, RoutedEventArgs e)
{
    // ignore the current misspelled word
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Ignore();
}

private void buttonDelete_Click(object sender, RoutedEventArgs e)
{
    // delete the current misspelled word
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Delete();
}
[Visual Basic]
Private Sub buttonChange_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' change the current misspelled word with the suggestion selected in the ListBox
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(listBoxSuggestions.SelectedItem.ToString)
End Sub

Private Sub buttonIgnore_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' ignore the current misspelled word
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Ignore()
End Sub

Private Sub buttonDelete_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' delete the current misspelled word
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Delete()
End Sub

2. The TextControl_Loaded event, where the SpellingCorrectionUIProvider class is connected to the TextControl. Furthermore a StateManaging_PropertyChanged event is defined to detect whether a misspelled word is currently available or not.

[C#]
private void textControl1_Loaded(object sender, RoutedEventArgs e)
{
    ...
    // attach an event to the property changed event
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(StateManaging_PropertyChanged);
    // connect the TextControl to the TX Spell correction user interface manager
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.SetCurrent(textControl1);
    ...
}

private void StateManaging_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
    // select the misspelled word in the TextControl
    if (e.PropertyName == "CurrentWordToCorrect")
    {
        if (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect != null)
        {
            ((TXTextControl.MisspelledWord)txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect).Select();
        }
        else {
            // if no misspelled word is available select nothing
            textControl1.Select(0, 0);
        }
    }
}
[Visual Basic]
Private Sub textControl1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ...
    ' attach an event to the property changed event
    AddHandler txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.PropertyChanged, AddressOf StateManaging_PropertyChanged
    ' connect the TextControl to the TX Spell correction user interface manager
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.SetCurrent(textControl1)
    ...
End Sub

Private Sub StateManaging_PropertyChanged(sender As Object, e As PropertyChangedEventArgs)
    ' select the misspelled word in the TextControl
    If e.PropertyName = "CurrentWordToCorrect" Then
        If txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect IsNot Nothing Then
            DirectCast(txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect, TXTextControl.MisspelledWord).[Select]()
        Else
            ' if no misspelled word is available select nothing
            textControl1.[Select](0, 0)
        End If
    End If
End Sub

>> Advanced spelling correction user interface


Advanced spelling correction user interface

WPF User's Guide > SpellingCorrectionUIProvider: Creating a spelling correction user interface.

Compared to SpellingCorrectionUIProvider Simple, four new features are added to the SpellingCorrectionUIProvider Advanced sample project:

  • Correcting all matches of the current misspelled word by using the ChangeAll, IgnoreAll and AddToDictionary methods
  • Selecting a dictionary to create suggestions
  • Displaying the sentence where the misspelled word is located
  • Setting a suggestion manually to correct the current misspelled word

The source code is contained in the following directories:

  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for WPF\Samples\WPF\CSharp\TextControl\SpellingCorrectionUIProvider\SpellingCorrectionUIProvider Advanced
  • %USERPROFILE%\My Documents\TX Spell 9.0.NET for WPF\Samples\WPF\VB.NET\TextControl\SpellingCorrectionUIProvider\SpellingCorrectionUIProvider Advanced

Correcting all matches of the current misspelled word by using the ChangeAll, IgnoreAll and AddToDicionary methods:

There are three new buttons to correct the current misspelled word and all of its occurrences: The 'Change All', 'Ignore All' and 'Add To Dict.' button. As previously described in Simple spelling correction user interface, the IsEnabled states of these Buttons are also bound inside the XAML code and the corresponding methods are handled by the Button's Click events.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeAllEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreAllEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsAddToDictionaryEnabled
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.ChangeAll
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IgnoreAll
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.AddToDictionary
<Button Name="buttonChangeAll"  VerticalAlignment="Top" Grid.Row="1" Margin="7" Content="Change All"
    Click="buttonChangeAll_Click"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.CorrectionHandling.IsChangeAllEnabled}">
</Button>

<Button Name="buttonIgnoreAll" VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" Margin="7" Content="Ignore All"
    Click="buttonIgnoreAll_Click"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.CorrectionHandling.IsIgnoreAllEnabled}">
</Button>

<Button Name="buttonAddToDict" VerticalAlignment="Top" Grid.Column="2" Grid.Row="1" Margin="7" Content="Add To Dict."
    Click="buttonDelete_Click"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.CorrectionHandling.IsAddToDictionaryEnabled}">
</Button>

[C#]
private void buttonChangeAll_Click(object sender, RoutedEventArgs e)
{
    ...
    // change the current misspelled word and all accordances with the suggestion selected in the ListBox
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.ChangeAll(listBoxSuggestions.SelectedItem.ToString());
    ...
}

private void buttonIgnoreAll_Click(object sender, RoutedEventArgs e)
{
    // ignore the current misspelled word and all accordances
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.IgnoreAll();
}

private void buttonAddToDict_Click(object sender, RoutedEventArgs e)
{
    // add the current misspelled word to a user dictionary
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.AddToDictionary();
}
[Visual Basic]
Private Sub buttonChangeAll_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ...
    ' change the current misspelled word and all accordances with the suggestion selected in the ListBox
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.ChangeAll(listBoxSuggestions.SelectedItem.ToString)
    ...
End Sub

Private Sub buttonIgnoreAll_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
     ' ignore the current misspelled word and all accordances
    txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.IgnoreAll()
End Sub

Private Sub buttonAddToDict_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' add the current misspelled word to a user dictionary
     txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.AddToDictionary()
End Sub

Selecting a dictionary to create suggestions:

In some cases, it is necessary to use more than one dictionary to correct a text. To provide suggestions of one or more specific dictionaries, the user can set the corresponding dictionaries by using the properties of the SuggestionDictionariesHandler class. The recommended way to handle these kind of operations is first getting those dictionaries where the language matches the language of the current misspelled word by calling the SuggestionDictionariesHandler.SuggestionDictionaries property and then adding one or more of these dictionaries to the SuggestionDictionariesHandler.SelectedSuggestionDictionaries property. If this operation causes the creation of new suggestions and the SuggestionsHandler.Suggestions property is bound to a ListBox (see Simple spelling correction user interface), the property and the suggestion ListBox are updated automatically.

In this example, the available suggestion dictionaries are provided by a ComboBox where the DataSource property is bound to the SuggestionDictionariesHandler.SuggestionDictionaries property. Additionally, the ComboBox's IsEnabled state is bound to the SuggestionDictionariesHandler.IsSuggestionDictionariesEnabled property. If the user changes the selected suggestion dictionary, the corresponding SelectionChanged event adds the new dictionary to the SuggestionDictionariesHandler.SelectedSuggestionDictionaries property.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.IsSuggestionDictionariesEnabled
  • Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SelectedSuggestionDictionaries
  • Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SuggestionDictionaries
<ComboBox Name="comboBoxSuggestionDictionaries" Grid.ColumnSpan="3" Grid.Row="3" Margin="3"
    SelectionChanged="comboBoxSuggestionDictionaries_SelectionChanged"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1},Path=SpellingCorrectionUIProvider.SuggestionDictionariesHandling.IsSuggestionDictionariesEnabled}"
    ItemsSource="{Binding Source={StaticResource txSpellChecker1},Path=SpellingCorrectionUIProvider.SuggestionDictionariesHandling.SuggestionDictionaries}" SelectedIndex="0">
</ComboBox>
[C#]
private void comboBoxSuggestionDictionaries_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    // Sets the current suggestion dictionaries combo box's selected dictionary as selected dictionary to use for creating suggestions
    txSpellChecker1.SpellingCorrectionUIProvider.SuggestionDictionariesHandling.SelectedSuggestionDictionaries = new TXTextControl.Proofing.Dictionary[] { (TXTextControl.Proofing.Dictionary)comboBoxSuggestionDictionaries.SelectedItem };
    listBoxSuggestions.SelectedIndex = 0;
}
[Visual Basic]
Private Sub comboBoxSuggestionDictionaries_SelectionChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
    ' Sets the current suggestion dictionaries combo box's selected dictionary as selected dictionary to use for creating suggestions
    txSpellChecker1.SpellingCorrectionUIProvider.SuggestionDictionariesHandling.SelectedSuggestionDictionaries = New TXTextControl.Proofing.Dictionary() {DirectCast(comboBoxSuggestionDictionaries.SelectedItem, TXTextControl.Proofing.Dictionary)}
    listBoxSuggestions.SelectedIndex = 0
End Sub

Displaying the sentence where the misspelled word is located:

Determining the sentence where the current misspelled word is located could be helpful to correct the word depending on its surrounding. For these cases the PreviewHandler.PreviewSentenceBounds property provides the index and the length of the misspelled word's sentence.

Applied to our example, the sentence extraction is handled by a class that is derived from the System.Windows.Data.IValueConverter interface. An instance of this converter is used for the Binding between the TextBlock.Text property and the PreviewHandler.PreviewSentenceBounds property. Consequently, on every PreviewSentenceBounds property change, the converter determines the misspelled word's sentence text and commits it to the TextBlock.Text property.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.PreviewHandler.PreviewSentenceBounds
  • Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect
<TextBlock Name="textBoxSentence" Grid.ColumnSpan="4" Grid.Row="1" Height="50" Margin="3,0" VerticalAlignment="Top"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1},Path=SpellingCorrectionUIProvider.PreviewHandling.IsPreviewSentenceBoundsEnabled}"
    Text="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.PreviewHandling.PreviewSentenceBounds,Converter={StaticResource previewBoundsConverter},ConverterParameter={StaticResource txSpellChecker1}}">
</TextBlock>
[C#]
public class PreviewBoundsConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
        if (value != null &&  parameter != null) {
            return GetMisspelledWordSentence((TXSpellChecker)parameter, (int[])value);
        }
        else {
            return "";
        }
    }

    // returns the sentence of the current word to correct.
    private string GetMisspelledWordSentence(TXSpellChecker p_txsSpellChecker, int[] p_riPreviewSentenceBounds) {
        TXTextControl.IFormattedText iftCurrentTextPart = (TXTextControl.IFormattedText)p_txsSpellChecker.SpellingCorrectionUIProvider.StateManaging.CurrentIFormattedText;
        TXTextControl.Paragraph pgMisspelledWordsParagraph = iftCurrentTextPart.Paragraphs.GetItem(((TXTextControl.MisspelledWord)p_txsSpellChecker.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect).Start);
        return pgMisspelledWordsParagraph.Text.Substring(p_riPreviewSentenceBounds[0] - (pgMisspelledWordsParagraph.Start - 1), p_riPreviewSentenceBounds[1]);
    }
}
[Visual Basic]
Public Class PreviewBoundsConverter
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
        If value IsNot Nothing AndAlso parameter IsNot Nothing Then
            Return GetMisspelledWordSentence(DirectCast(parameter, TXSpellChecker), DirectCast(value, Integer()))
        Else
            Return ""
        End If
    End Function

    ' returns the sentence of the current word to correct.
    Private Function GetMisspelledWordSentence(ByVal p_txsSpellChecker As TXSpellChecker, ByVal p_riPreviewSentenceBounds As Integer()) As String
        Dim iftCurrentTextPart As TXTextControl.IFormattedText = DirectCast(p_txsSpellChecker.SpellingCorrectionUIProvider.StateManaging.CurrentIFormattedText, TXTextControl.IFormattedText)
        Dim pgMisspelledWordsParagraph As TXTextControl.Paragraph = iftCurrentTextPart.Paragraphs.GetItem(DirectCast(p_txsSpellChecker.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect, TXTextControl.MisspelledWord).Start)
        Return pgMisspelledWordsParagraph.Text.Substring(p_riPreviewSentenceBounds(0) - (pgMisspelledWordsParagraph.Start - 1), p_riPreviewSentenceBounds(1))
    End Function
End Class

Setting a suggestion manually to correct the current misspelled word:

Sometimes, no suggestions can be created for a misspelled word. In this case, the user needs an interface to correct the word manually.

The SpellingCorrectionUIProvider Advanced sample project provides a TextBox to give the user the option to edit the current misspelled word which is updated inside the box on every StateManager.CurrentWordToCorrect property change. The edited word is applied when the user clicks the 'Change' or 'Change All' button.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect
  • Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Change
  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.ChangeAll
<TextBox Grid.ColumnSpan="3" Grid.Row="3" Margin="3,0" Name="textBoxEdit" VerticalAlignment="Top" Width="180"
    Text="{Binding Source={StaticResource txSpellChecker1},Mode=OneWay, Path=SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect,Converter={StaticResource wordToCorrectConverter},NotifyOnTargetUpdated =True}"
    TextChanged="textBoxEdit_TextChanged" PreviewKeyDown="textBoxEdit_PreviewKeyDown" TargetUpdated="textBoxEdit_TargetUpdated">
</TextBox>
[C#]
public class MisspelledWordConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
        MisspelledWord mwWordToCorrect = (MisspelledWord)value;
        if (mwWordToCorrect == null) {
            return "";
        }
        else {
            return mwWordToCorrect.Text;
        }
    }
}

private void buttonChange_Click(object sender, RoutedEventArgs e)
{
    if (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing)
    {
        // change the current misspelled word with the text box' text.
        txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(textBoxEdit.Text);
    }
    else {
        // change the current misspelled word with the suggestion selected in the ListBox
        txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(listBoxSuggestions.SelectedItem.ToString());
    }
}
[Visual Basic]
Public Class MisspelledWordConverter
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
        Dim mwWordToCorrect As MisspelledWord = DirectCast(value, MisspelledWord)
        If mwWordToCorrect Is Nothing Then
            Return ""
        Else
            Return mwWordToCorrect.Text
        End If
    End Function
End Class

Private Sub buttonChange_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    If txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing Then
        ' change the current misspelled word with the text box' text.
        txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(textBoxEdit.Text)
    Else
        ' change the current misspelled word with the suggestion selected in the ListBox
        txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.Change(listBoxSuggestions.SelectedItem.ToString)
    End If
End Sub

Additionally, the TextBox's TextChanged event calls the CorrectionHandler.CheckCorrectedWord method to check whether the edited TextBox' text is correct or not.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.CheckCorrectedWord
  • Proofing.SpellingCorrectionUIProvider.StateManager.Mode
[C#]
private void textBoxEdit_TextChanged(object sender, TextChangedEventArgs e)
{
    if (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.Mode != TXTextControl.Proofing.TXSpell.SpellingCorrectionMode.WordToCorrectIsDuplicate)
    {
        if (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.Mode != TXTextControl.Proofing.TXSpell.SpellingCorrectionMode.CorrectionCompleted)
        {
            string message;
            if (txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.CheckCorrectedWord(textBoxEdit.Text, out message))
            {
                // ... do something to show that the text box's text is correct
            }
            else
            {
                // ... do something to show that the text box's text is still incorrect
            }
        }
        else
        {
            // ... the spelling correction is completed. There is no text to check for correctness
        }
    }
}
[Visual Basic]
Private Sub textBoxEdit_TextChanged(ByVal sender As Object, ByVal e As TextChangedEventArgs)
    If (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.Mode <> TXTextControl.Proofing.TXSpell.SpellingCorrectionMode.WordToCorrectIsDuplicate) Then
        If (txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.Mode <> TXTextControl.Proofing.TXSpell.SpellingCorrectionMode.CorrectionCompleted) Then
            Dim message As String = String.Empty
            If txSpellChecker1.SpellingCorrectionUIProvider.CorrectionHandling.CheckCorrectedWord(textBoxEdit.Text, message) Then
                ' ... do something to show that the text box's text is correct
            Else
                ' ... do something to show that the text box's text is still incorrect
            End If
        Else
            ' ... the spelling correction is completed. There is no text to check for correctness
        End If
    End If
End Sub

To inform the SpellingCorrectionUIProvider that the user is currently editing the word manually, the StateManager.IsWordToCorrectEditing property is set to true on the first editing operation. To leave the editing mode, the user can press the 'Undo Edit' button where the Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing property is set to false.

Relevant API links:

  • Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsUndoEditEnabled
  • Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing
  • Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect
<Button Name="buttonUndoEdit" VerticalAlignment="Top" Grid.Column="3" Grid.Row="3" Margin="0,0,3,0" Content="Undo Edit"
    IsEnabled="{Binding Source={StaticResource txSpellChecker1}, Path=SpellingCorrectionUIProvider.CorrectionHandling.IsUndoEditEnabled}"
    Click="buttonUndoEdit_Click">
</Button>
[C#]
private void textBoxEdit_PreviewKeyDown(object sender, KeyEventArgs e)
{
    // start word editing
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing = true;
}

private void buttonUndoEdit_Click(object sender, RoutedEventArgs e)
{
    // abort word editing
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing = false;
    textBoxEdit.Text = ((TXTextControl.MisspelledWord)txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect).Text;
    buttonIgnore.Focus();
}
[Visual Basic]
Private Sub textBoxEdit_PreviewKeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
    ' start word editing
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing = true
End Sub

Private Sub buttonUndoEdit_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    ' abort word editing
    txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.IsWordToCorrectEditing = false
    textBoxEdit.Text = CType(txSpellChecker1.SpellingCorrectionUIProvider.StateManaging.CurrentWordToCorrect,TXTextControl.MisspelledWord).Text
    buttonIgnore.Focus()
End Sub


SpellCheckDialog by SpellingCorrectionUIProvider

WPF User's Guide > SpellingCorrectionUIProvider: Creating a spelling correction user interface.

The sample project Custom SpellCheckDialog shows how to create a fully operational spell check dialog. Its functionality is completely based on the SpellingCorrectionUIProvider methods and properties that were introduced by the previous articles Simple spelling correction user interface and Advanced spelling correction user interface.

The major differences to these samples lie in connecting the TextControl before opening the dialog, handling a preview where to correct manually the current misspelled word, changing the functionality of a button depending on the StateManager.Mode and implementing a Button to open the OptionsDialog.

In the following, the underlying concepts behind these issues are described, but it won't give any further explanation in code details. Therefore, we ask you to explore the Custom SpellCheckDialog sample more closely by yourself.

Connecting the TextControl before opening the dialog

The principal task of a spell check dialog is to correct the current misspelled words one by one with a correction supporting user interface. But opening such a dialog makes only sense, if the TextControl actually contains misspelled words. To prevent an unnecessary initializing of the spell check dialog, the TextControl should be first connected with the SpellingCorrectionUIProvider to determine its mode. If it is set to SpellingCorrectionMode.NoWordsToCorrectFound, the dialog won't be opened and a MessageBox informs the user that the TextControl does not contain any misspelled words. Whether or not the dialog is shown, the SpellingCorrectionUIProvider should be reset to its initial state by using the StateManager.Cancel method.

Handling a preview

Most spell check dialogs provide a preview that gives the user an opportunity to correct the current misspelled word manually. Such an editor usually shows the sentence where the misspelled word is located and highlights it in red color. Additionally, on starting editing inside the preview, the rest of the dialog changes to an editing mode, where most buttons and controls are disabled and the 'Ignore' button is changed to an 'Undo Edit' button.

To implement this behavior, the SpellingCorrectionUIProvider provides the StateManager.IsWordToCorrectEditing property that changes the current mode to SpellingCorrectionMode.WordToCorrectEditing. In this case, bound Button's and Control's are disabled, except the 'Change' and 'Change All' buttons. However, in this example, the Clicked events of these two buttons won't commit the selected suggestion of the suggestion ListBox anymore, but the modified misspelled word from the preview editor as the change parameter. Furthermore, to give the user the chance to cancel misspelled word editing using the preview, the 'Ignore' button is changed to an 'Undo Edit' button, where its Clicked event sets the StateManager.IsWordToCorrectEditing to false. The preview itself is updated on every current misspelled word change or use of the 'Undo Edit' button.

Changing the functionality of a button

There are two cases where the functionality of a button can be changed. The first one, as described above, is when the 'Ignore' needs to be an 'Undo Edit' button. The other one is when the misspelled word is a duplicated word. In this case, the 'Change' button becomes a 'Delete' button and its Clicked event calls the CorrectionHandler.Delete method instead the CorrectionHandler.Change method.

Open an OptionsDialog

In most spell check dialogs, the user can change some spelling settings, by opening an options dialog. To adopt any changes by these modifications, the connected TextControl must be spell checked again on closing the options dialog. The StateManager.IsOptionsSettings property supports that behavior: Before opening the options dialog, it must be set to true, to save any prior ignore operations. When the dialog is closed, the property is set to false, which leads to a spell check of the TextControl and a resetting of the stored, ignored words.

<< Advanced spelling correction user interface


Resource Kit

This chapter shows how to use the resource kit that enables developers to display TX Spell .NET's user interface parts in languages other than English and German.

Resource Kit


Resource Kit

Resource Kit

TX Spell .NET offers a Resource Kit that enables developers to display TX Spell .NET's user interface parts in languages other than English and German. English and German are the built-in resources and cannot be changed. All other languages are possible with the satellite assembly mechanism the prefered mechanism for localization within the .NET Framework. The following describes how to build a satellite assembly.

TX Text Control Resources

Resource Kit Files

Building the Satellite Assembly

Installing the Satellite Assembly


TX Text Control Resources

Resource Kit > Resource Kit

TX Spell .NET has built-in dialog boxes and error strings. The language used for the parts of the .NET Framework depend on the current system language. Therefore, the built-in TX Spell .NET resources follow this mechanism and also depend on the current system language. For example, if a developer builds a satellite assembly for French, the French resources are only loaded if the current system language is also French.

>> Resource Kit Files


Resource Kit Files

Resource Kit > Resource Kit

The ResourceKit directory, which is a subdirectory of your TX Spell .NET main installation directory, contains all necessary files. The TXSpell.resx file contains all built-in resources in a human readable XML format. All parts of dialog boxes appear as strings.

The buildres.bat file is a command line batch file that calls the command line tools of the .NET Framework SDK necessary to build the satellite assembly.

The txtextcontrol.public.snk file contains Text Control's public key also necessary to build the satellite assembly.


Building the Satellite Assembly

Resource Kit > Resource Kit

To build a satellite assembly for TX Spell .NET, perform the following tasks:

1. Install at least the .NET Framework SDK.

2. Translate all the text resources in the TXSpell.resx file. The text resources are the contents of the value tags.

3. Call the buildres.bat batch file with the two letter language code specified through ISO 639 as parameter (for example French: buildres fr). The batch process builds the satellite assembly file TXSpell.resources.dll.


Installing the Satellite Assembly

Resource Kit > Resource Kit

The newly created assembly must be located in a subdirectory of your application's installation directory, which must contain all necessary TX Spell .NET files. The name of the subdirectory must be the two letter language code. For example to install a French satellite assembly create a subdirectory fr and copy TXSpell.resources.dll to this directory.

Additionally, create the following registry key to ensure that the .NET Framework uses custom builds of satellite assemblies with your application:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TXSpell.resources,6B83FE9A75CFB638]

<< Building the Satellite Assembly


Distributing your Applications

This chapter lists the TX Spell .NET files that must be deployed with your applications.

Redistributable Files


Redistributable Files

You must ensure that all necessary directories with the corresponding files exist on your client's machine. These folders are the \Assembly\Dictionaries, the \Assembly\HyphenationLists, the \Assembly\LanguageRecognition and the \Assembly\SynonymLists directories that can be found in the \Assemblyof your TX Spell .NET installation directory.

For a Windows Forms or a WPF application all necessary files must be copied into the same folder as your application's executable program file. When deploying an ASP.NET application, these files must be copied into the ASP.NET Bin folder.

TX Spell .NET Windows Forms Components (\Assembly subdirectory):

  • TXSpell.Windows.Forms.dll (9.0.800.500)

TX Spell .NET WPF Components (\Assembly subdirectory):

  • TXSpell.WPF.dll (9.0.800.500)

TX Spell .NET core assembly (\Assembly subdirectory):

  • TXSpell.dll (9.0.800.500)

TX Spell .NET dictionaries(\Assembly\Dictionaries subdirectory):

  • en_US.aff
  • en_US.dic

TX Spell .NET hyphenation lists(\Assembly\HyphenationLists subdirectory):

  • hyph_en_US.dic

TX Spell .NET language recognition(\Assembly\LanguageRecognition subdirectory):

  • languageRecognition.resources

TX Spell .NET synonym lists(\Assembly\SynonymLists subdirectory):

  • th_en_US_v2.dat
  • th_en_US_v2.idx

All used dictionaries, hyphenation lists, synonym lists and the languageRecognition.resources file in these subdirectories are automatically used by TX Spell .NET. TX Spell .NET supports most Hunspell OpenOffice dictionaries, hyphenation lists and synonym lists. Please refer to their licenses for license details or limitations.


Dictionaries, Hyphenation and Synonym Lists

This section shows how to use dictionaries, hyphenation and synonym lists with TX Spell .NET.

OpenOffice.org Hunspell dictionary support

Working with dictionaries

Working with hyphenation lists

Working with synonym lists


OpenOffice.org Hunspell dictionary support

TX Spell .NET supports Hunspell dictionaries from OpenOffice.org. These sophisticated, very well tested and improved dictionaries are available in more than 60 languages. Most of them are licensed under LGPL which enables you to freely use and distribute these dictionaries in your applications without limitations. Please refer to their specific licenses for further details.

We are constantly testing all available dictionaries and newer versions of the dictionaries with TX Spell .NET. The approved dictionaries are available for download on our website:

http://www.textcontrol.com/downloads/dictionaries/

After downloading a dictionary, unzip it and place the files into the default dictionary folder.


Working with dictionaries

TX Spell .NET is designed for the very special requirements of professional word processing applications. Performance is the main aspect when it comes to spell checking. Depending on the used dictionaries, TX Spell .NET is able to check more than 40.000 words in less than a second on average. This performance allows TX Spell .NET to be used with more dictionaries at the same time which enables users to check multi-language documents.

Default dictionary folder

Integrating TX Spell .NET into a Visual Studio project is very easy. The default settings and shipped dictionaries allow developers to create applications without any specific dictionary settings. TX Spell .NET checks by default the preset Dictionaries subfolder for valid dictionaries. On a development machine, that folder is located in the \Assembly\Dictionaries subdirectory in the TX Spell .NET installation directory. When the application is deployed to an end-user's machine, the Dictionaries directory is a direct subfolder of the application's root folder. Alternatively, a custom dictionaries folder can be determined by specifying a directory path with the DictionariesDirectoryPath property.

The DictionaryCollection contains all initialized dictionaries. To enable a dictionary, it must be added to this collection.

The TXSpell.Language property is set to "(Auto)" when the TXSpellChecker has been created on a form.

The dictionary of the language of the application environment will be added to the TXSpell.Dictionaries collection automatically. If the default dictionary folder does not contain such a dictionary, a dictionary will be chosen, which corresponds roughly to the environment language (e.g. the application environment is "en_GB", but the default dictionary folder only contains an "en_US" and a "de_DE" dictionary. In this case the "en_US" dictionary will be chosen.). In all other cases (e.g. a German environment, but no German dictionary available) the "en_US" dictionary or (if no "en_US" dictionary available) the first dictionary inside the default dictionary folder is loaded.

Each Dictionary has a Dictionary.IsSpellCheckingEnabled property that must be set to true (default) in order to enable this dictionary in the DictionaryCollection. This property can be used to control whether the dictionary should be used for spell checking or not. This makes it possible to add a specific dictionary which is disabled, but used for creating the suggestions.


Working with hyphenation lists

With version 4.0, TX Spell .NET provides the possibility to check words or complete sentences for hyphenation points. Combined with TX Text Control version 20.0, this feature enables a fast way to hyphenate documents with one or more language regions.

Default hyphenation lists folder

Integrating TX Spell .NET into a Visual Studio project is very easy. The default settings and shipped hyphenation lists allow developers to create applications without any specific hyphenation lists settings. TX Spell .NET checks by default the preset HyphenationLists subfolder for valid hyphenation lists. On a development machine, that folder is located in the \Assembly\HyphenationLists subdirectory of the TX Spell .NET installation directory. When the application is deployed to an end-user's machine, the HyphenationLists directory is a direct subfolder of the application's root folder. Alternatively, a custom dictionaries folder can be determined by specifying a directory path with the HyphenationListsDirectoryPath property.

The HyphenationListCollection contains all initialized hyphenation lists. To enable a hyphenation list, it must be added to this collection.

The TXSpell.HyphenationLanguage property is set to "(Auto)" when the TXSpellChecker has been created on a form.

If the HyphenationLanguage property is set to "(Auto)", a hyphenation list is chosen where its language corresponds to the language of the dictionary that has been set by the TXSpell.Language property (by setting "(Auto)" or a specific hyphenation list). In case the default hyphenation lists folder does not contain such a list, a hyphenation list is chosen that corresponds roughly to the defined language. If the TXSpell.Language property is set to "(none)", a hyphenation list of the application environment's language (or, if not found, a list that corresponds roughly to the application environment's language) is added to the TXSpell.HyphenationLists collection.


Working with synonym lists

With version 7.0, TX Spell .NET provides the possibility to generate groups of synonyms for specific words. Combined with TX Text Control version 25.0, this feature enables a way to determine and set equivalent expressions for words at the current TextControl input position.

Default synonym lists folder

Integrating TX Spell .NET into a Visual Studio project is very easy. The default settings and shipped synonym lists allow developers to create applications without any specific synonym lists settings. TX Spell .NET checks by default the preset SynonymLists subfolder for valid synonym lists. On a development machine, that folder is located in the \Assembly\SynonymLists subdirectory of the TX Spell .NET installation directory. When the application is deployed to an end-user's machine, the SynonymLists directory is a direct subfolder of the application's root folder. Alternatively, a custom dictionaries folder can be determined by specifying a directory path with the SynonymListsDirectoryPath property.

The SynonymListCollection contains initialized synonym lists which are used to generate synonyms with the first and second overload of the TXSpell.CreateSynonyms method. As opposed to this, the third overload can be applied with a synoynm list that is not necessarily added to this collection.

The TXSpell.SynonymLanguage property is set to "(Auto)" when the TXSpellChecker has been created on a form.

If the SynonymLanguage property is set to "(Auto)", a synonym list is chosen where its language corresponds to the language of the dictionary that has been set by the TXSpell.Language property (by setting "(Auto)" or a specific synonym list). In case the default synonym lists folder does not contain such a list, a synonym list is chosen that corresponds roughly to the defined language. If the TXSpell.Language property is set to "(none)", a synonym list of the application environment's language (or, if not found, a list that corresponds roughly to the application environment's language) is added to the TXSpell.SynonymLists collection.


Class Library Reference

The TX Spell .NET class library in detail and alphabetical order.

Enumerations

TXTextControl.Proofing.DialogButton Class

TXTextControl.Proofing.DialogButtonCollection Class

TXTextControl.Proofing.DialogButtonEventArgs Class

TXTextControl.Proofing.Dictionary Class

TXTextControl.Proofing.DictionaryAddedEventArgs Class

TXTextControl.Proofing.DictionaryCollection Class

TXTextControl.Proofing.DictionaryRemovedEventArgs Class

TXTextControl.Proofing.HyphenationList Class

TXTextControl.Proofing.HyphenationListCollection Class

TXTextControl.Proofing.IncorrectWord Class

TXTextControl.Proofing.IncorrectWordChangingEventArgs Class

TXTextControl.Proofing.IncorrectWordCollection Class

TXTextControl.Proofing.LanguageScope Class

TXTextControl.Proofing.LanguageScopeCollection Class

TXTextControl.Proofing.MenuItem Class

TXTextControl.Proofing.MenuItemClickedEventArgs Class

TXTextControl.Proofing.MisspelledWordChangingEventArgs Class

TXTextControl.Proofing.OpenOfficeDictionary Class

TXTextControl.Proofing.OptionsDialogOpeningEventArgs Class

TXTextControl.Proofing.Preview Class

TXTextControl.Proofing.ShowDialogSettings Class

TXTextControl.Proofing.SpellCheckDialog Class

TXTextControl.Proofing.SpellCheckDialogClosingEventArgs Class

TXTextControl.Proofing.SpellCheckDialogOpeningEventArgs Class

TXTextControl.Proofing.SpellCheckDialogStateManager Class

TXTextControl.Proofing.SpelledWord Class

TXTextControl.Proofing.SpellingCorrectionUIProvider Class

TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler Class

TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandler Class

TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager Class

TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler Class

TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler Class

TXTextControl.Proofing.Suggestion Class

TXTextControl.Proofing.SuggestionCollection Class

TXTextControl.Proofing.SuggestionDictionaryComboBox Class

TXTextControl.Proofing.SuggestionList Class

TXTextControl.Proofing.Synonym Class

TXTextControl.Proofing.SynonymGroup Class

TXTextControl.Proofing.SynonymList Class

TXTextControl.Proofing.SynonymListCollection Class

TXTextControl.Proofing.TXSpell Class

TXTextControl.Proofing.TXSpellChecker Class

TXTextControl.Proofing.UserDictionary Class

TXTextControl.Proofing.UserDictionaryWordAddedEventArgs Class

TXTextControl.Proofing.UserDictionaryWordRemovedEventArgs Class

TXTextControl.WPF.Proofing.DialogButton Class

TXTextControl.WPF.Proofing.DialogButtonCollection Class

TXTextControl.WPF.Proofing.DialogButtonEventArgs Class

TXTextControl.WPF.Proofing.MenuItem Class

TXTextControl.WPF.Proofing.MenuItemClickedEventArgs Class

TXTextControl.WPF.Proofing.OptionsDialogOpeningEventArgs Class

TXTextControl.WPF.Proofing.Preview Class

TXTextControl.WPF.Proofing.ShowDialogSettings Class

TXTextControl.WPF.Proofing.SpellCheckDialog Class

TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs Class

TXTextControl.WPF.Proofing.SpellCheckDialogOpeningEventArgs Class

TXTextControl.WPF.Proofing.SpellCheckDialogStateManager Class

TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox Class

TXTextControl.WPF.Proofing.SuggestionList Class

TXTextControl.WPF.Proofing.TXSpellChecker Class


Enumerations

TXTextControl.Proofing.TXSpell.ButtonType Enumeration

TXTextControl.Proofing.TXSpell.ChangeType Enumeration

TXTextControl.Proofing.TXSpell.DialogStartPosition Enumeration

TXTextControl.Proofing.TXSpell.IgnoreCaseSettings Enumeration

TXTextControl.Proofing.TXSpell.IgnoreWordSettings Enumeration

TXTextControl.Proofing.TXSpell.MenuItemType Enumeration

TXTextControl.Proofing.TXSpell.SpellingCorrectionMode Enumeration


TXTextControl.Proofing.TXSpell.ButtonType Enumeration

Determines the type of a DialogButton (Windows Forms or WPF). The enumeration contains the following values:

Member | Description
AddToDictionary | Specifies a DialogButton that corresponds to the bahavior of an 'Add To Dictionary' spell check dialog button.
Change | Specifies a DialogButton that corresponds to the bahavior of a 'Change' spell check dialog button.
ChangeAll | Specifies a DialogButton that corresponds to the bahavior of a 'Change All' spell check dialog button.
Delete | Specifies a DialogButton that corresponds to the bahavior of a 'Delete' spell check dialog button.
Ignore | Specifies a DialogButton that corresponds to the bahavior of an 'Ignore Once' spell check dialog button.
IgnoreAll | Specifies a DialogButton that corresponds to the bahavior of an 'Ignore All' spell check dialog button.
Options | Specifies a DialogButton that corresponds to the bahavior of an 'Options...' spell check dialog button.
UndoEdit | Specifies a DialogButton that corresponds to the bahavior of an 'Undo Edit' spell check dialog button.
User | Specifies a DialogButton that corresponds to a user defined bahavior.

>> TXTextControl.Proofing.TXSpell.ChangeType Enumeration


TXTextControl.Proofing.TXSpell.ChangeType Enumeration

Determines how an object of type TXTextControl.MisspelledWord or IncorrectWord is changed by a SpellCheckDialog or spell check menu item click operation. The enumeration contains the following values:

Member | Description
Delete | The misspelled word is deleted. If the misspelled word is an object of type IncorrectWord the Start and Length properties of the IncorrectWord are specified to the index and length of the corresponding text that would be removed.
Ignore | The misspelled word is ignored.
Replace | The misspelled word is replaced by another (MisspelledWordChangingEventArgs.CorrectedWord / IncorrectWordChangingEventArgs.CorrectedWord).


TXTextControl.Proofing.TXSpell.DialogStartPosition Enumeration

Specifies the position that the options or spell check dialog will be shown in when it is opened. The enumeration contains the following values:

Member | Description
Manual | The position of the dialog is determined by the ShowDialogSettings.Location property.
CenterScreen | The dialog is centered on the current display.
CenterOwner | The dialog is centered within the bounds of the window that owns it.


TXTextControl.Proofing.TXSpell.IgnoreCaseSettings Enumeration

Determines whether and how the specific case of a word is ignored. The enumeration contains the following values:

Value | Description
AllLower | The case of the word is ignored, if all characters are lowercase.
AllUpper | The case of the word is ignored, if all characters are uppercase.
Always | The case of the word is always ignored.
Never | The case of the word is never ignored.
WordBegin | The case of the first word character is ignored.
WordBeginUpper | The case of the first word character is ignored, if it is uppercase.


TXTextControl.Proofing.TXSpell.IgnoreWordSettings Enumeration

Determines whether a word is spell checked or not. The enumeration contains the following values:

Value | Description
InUpperCase | The word is not spell checked, if all characters are uppercase.
Duplicated | Duplicated words are not spell checked.
IsEmail | The word is not spell checked, if it is an e-mail address.
IsURL | The word is not spell checked, if it is an URL.
Never | The word is always spell checked.
WithNumbers | The word is not spell checked, if it contains numbers.


TXTextControl.Proofing.TXSpell.MenuItemType Enumeration

Determines the type of a menu item (Windows.Forms or WPF). The enumeration contains the following values:

Value | Description
AddToDictionary | Clicking a MenuItem of type 'AddToDictionary' causes the misspelled word to be added to all editable user dictionaries and removed from the corresponding collection (TXTextControl.MisspelledWordCollection / IncorrectWordCollection).
Delete | Clicking a MenuItem of type 'Delete' causes the misspelled word to be removed from the corresponding collection (TXTextControl.MisspelledWordCollection / IncorrectWordCollection). If the misspelled word is an object of type TXTextControl.MisspelledWord, it is removed from the TXTextControl.TextControl text.
IgnoreAll | Clicking a MenuItem of type 'IgnoreAll' causes all misspelled words, that have the same text like the current misspelled word, to be ignored. If the misspelled word is an object of type TXTextControl.MisspelledWord (TX Text Control version X8 and higher), the IsIgnored property of all similar misspelled words is set to true. If the TX Text Control version is 17.0 or the misspelled word is an object of type IncorrectWord, all ignorable words are removed from the corresponding collection.
IgnoreOnce | Clicking a MenuItem of type 'IgnoreOnce' causes the misspelled word to be ignored. If the word is an object of type TXTextControl.MisspelledWord (TX Text Control version X8 and higher), its IsIgnored property is set to true. If the TX Text Control version is 17.0 or the misspelled word is an object of type IncorrectWord, the word is removed from the corresponding collection.
NoSuggestions | Clicking a MenuItem of type NoSuggestionsNoSuggestions raises the Proofing.TXSpellChecker.MenuItemClicked event. No collection will be changed.
Suggestion | Clicking a MenuItem of type 'Suggestion' causes the misspelled word to be replaced with a another word. That suggested word will be represented by the MenuItem.Text property or the CorrectedWord property of the MisspelledWordChangingEventArgs (for TXTextControl.MisspelledWord) / IncorrectWordChangingEventArgs (for IncorrectWord). If the misspelled word is an object of type TXTextControl.MisspelledWord, it is replaced with the suggested word inside TXTextControl.TextControl. If the misspelled word is an object of type IncorrectWord, the word is removed from the corresponding collection


TXTextControl.Proofing.TXSpell.SpellingCorrectionMode Enumeration

The enumeration contains the following values:

Value | Description
CorrectionCompleted | The spelling correction ist completed. All prior uncorrected words were handled by methods of the TXSpell.SpellingCorrectionUIProvider.CorrectionHandler with the result, that the source (CurrentTextControl or CurrentText) of these words does not have further words to correct. In this the CurrentWordToCorrect property is set to null.
InitialState | The SpellingCorrectionUIProvider is set to its initial state. This value only appears if no TXTextControl.TextControl and no text are conntected to the SpellingCorrectionUIProvider. It is the initial state before setting the first time a TXTextControl.TextControl or text and can be forced by calling the Cancel method or SetCurrent with a null parameter. Under this mode it is not possible to force any spelling correction by using the SpellingCorrectionUIProvider.
NoSuggestionsCreated | Based on the selected suggestions dictionaries no suggestions were created for the current word to correct.
NoWordToCorrectSelected | The SetCurrent(int textPosition, object iFormattedText) or SetCurrent(int textPosition) method was called with the result, that there was no uncorrected word found at the specified text position. In this the CurrentWordToCorrect property are set to null.
NoWordsToCorrectFound | No correct words were found on setting the current textcontrol or text. In this case whether the CurrentWordToCorrect, nor the CurrentIFormattedText property of the TXSpell.SpellingCorrectionUIProvider.StateManager is set. Therefore no spelling correction based on the SpellingCorrectionUIProvider can be forced.
OptionsSettings | The SpellingCorrectionUIProvider is set to the only a mode were it is possible to modify options settings such as TXSpell.IgnoreWord, TXSpell.IgnoreCase or TXSpell.Dictionaries which have an effect on theTXSpell spell checking behavior.
SuggestionsCreated | Based on the selected suggestions dictionaries an array of suggestions was created for the current word to correct.
WordToCorrectEditing | The SpellingCorrectionUIProvider is set to a mode that corresponds to the state of a spell check dialog where the current word to correct is edited by the preview.
WordToCorrectIsDuplicate | The current word to correct is kind of duplicated word.

<< TXTextControl.Proofing.TXSpell.MenuItemType Enumeration


TXTextControl.Proofing.DialogButton Class

The DialogButton class represents a button of the built-in SpellCheckDialog. Objects of this class can be added or removed to the dialog by modifying the SpellCheckDialog.IgnoreButtons, SpellCheckDialog.ChangeButtons and SpellCheckDialog.OptionButtons dialog button collections.

Introduced: 3.0.

Syntax

[C#]
public sealed class DialogButton
[Visual Basic]
Public NotInheritable Class DialogButton

Constructors

Constructor | Description
DialogButton | Initializes a new instance of the DialogButton class.

Properties

Property | Description
Enabled | Gets or sets a value indicating whether the DialogButton can respond to user interaction.
Font | Gets or sets the font of the text displayed by the DialogButton.
IsDeleteButton | Gets or sets a value specifying the DialogButton text.
IsUndoEditButton | Gets or sets a value specifying the DialogButton text.
Text | Gets or sets the text displayed by the DialogButton.
Type | Gets a value of type ButtonType that is specified for the DialogButton.


TXTextControl.Proofing.DialogButton Constructor

Initializes a new instance of the DialogButton class.

Syntax

[C#]
public DialogButton(Proofing.TXSpell.ButtonType type);
[Visual Basic]
Public Sub New(type As Proofing.TXSpell.ButtonType)
Parameter | Description
type | Specifies one of the ButtonType values.

>> TXTextControl.Proofing.DialogButton.Enabled Property


TXTextControl.Proofing.DialogButton.Enabled Property

Gets or sets a value indicating whether the DialogButton can respond to user interaction.

Syntax

[C#]
public bool Enabled { get; set; }
[Visual Basic]
Public Property Enabled() As Boolean


TXTextControl.Proofing.DialogButton.Font Property

Gets or sets the font of the text displayed by the DialogButton.

Syntax

[C#]
public System.Drawing.Font Font { get; set; }
[Visual Basic]
Public Property Font() As System.Drawing.Font


TXTextControl.Proofing.DialogButton.IsDeleteButton Property

Gets or sets a value specifying the DialogButton text. The behavior changes to a Delete button, if the incorrect word (TXTextControl.MisspelledWord) is a duplicated word (TXTextControl.MisspelledWord.IsDuplicate).

Syntax

[C#]
public bool IsDeleteButton { get; set; }
[Visual Basic]
Public Property IsDeleteButton() As Boolean


TXTextControl.Proofing.DialogButton.IsUndoEditButton Property

Gets or sets a value specifying the DialogButton text. The behavior changes to an Undo Edit button, if the preview text of the SpellCheckDialog is manually modified. When no button in the dialog is set to true, the preview text is not editable.

Syntax

[C#]
public bool IsUndoEditButton { get; set; }
[Visual Basic]
Public Property IsUndoEditButton() As Boolean


TXTextControl.Proofing.DialogButton.Text Property

Gets or sets the text displayed by the DialogButton.

Syntax

[C#]
public string Text { get; set; }
[Visual Basic]
Public Property Text() As String


TXTextControl.Proofing.DialogButton.Type Property

Gets a value of type ButtonType that is specified for the DialogButton.

Syntax

[C#]
public Proofing.TXSpell.ButtonType Type { get; }
[Visual Basic]
Public ReadOnly Property Type() As Proofing.TXSpell.ButtonType

Limitations

Read only.

<< TXTextControl.Proofing.DialogButton.Text Property


TXTextControl.Proofing.DialogButtonCollection Class

An instance of the DialogButtonCollection class contains all objects of type DialogButton that represent the dialog buttons of the built-in SpellCheckDialog. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference.

Introduced: 3.0.

Syntax

[C#]
public sealed class DialogButtonCollection: CollectionBase, IEnumerable, IEnumerator
[Visual Basic]
Public NotInheritable Class DialogButtonCollection
  Inherits CollectionBase
  Implements IEnumerable
  Implements IEnumerator

Methods

Method | Description
Add | Adds an object of type DialogButton to the collection.
AddRange | Adds a collection of DialogButtons to the collection.
Item | Gets a DialogButton from the collection.
Remove | Removes an object of type DialogButton from the collection.


TXTextControl.Proofing.DialogButtonCollection.Add Method

Adds an object of type DialogButton to the collection.

Syntax

[C#]
public void Add(Proofing.DialogButton button);
[Visual Basic]
Public Sub Add(button As Proofing.DialogButton)
Parameter | Description
button | Specifies an object of type DialogButton.

Remarks

This method throws an exception when called while the SpellCheckDialog is open.

>> TXTextControl.Proofing.DialogButtonCollection.AddRange Method


TXTextControl.Proofing.DialogButtonCollection.AddRange Method

Adds a collection of DialogButtons to the collection.

Syntax

[C#]
public void AddRange(IEnumerable<Proofing.DialogButton> collection);
[Visual Basic]
Public Sub AddRange(collection As IEnumerable(Of Proofing.DialogButton))
Parameter | Description
collection | Specifies the collection of DialogButtons.

Remarks

This method throws an exception when called while the SpellCheckDialog is open.


TXTextControl.Proofing.DialogButtonCollection.Item Property

Gets a DialogButton from the collection. This property is the indexer for the DialogButtonCollection class.

Syntax

[C#]
public Proofing.DialogButton this [int number] { get; }
[Visual Basic]
Public Default ReadOnly Property Item(number As Integer) As Proofing.DialogButton
Parameter | Description
number | The zero-based index of the DialogButton.

Return Value

The object of the type DialogButton at the specified index.


TXTextControl.Proofing.DialogButtonCollection.Remove Method

Removes an object of type DialogButton from the collection.

Syntax

[C#]
public void Remove(Proofing.DialogButton button);
[Visual Basic]
Public Sub Remove(button As Proofing.DialogButton)
Parameter | Description
button | Specifies an object of type DialogButton.

Remarks

This method throws an exception when called while the SpellCheckDialog is open.

<< TXTextControl.Proofing.DialogButtonCollection.Item Property


TXTextControl.Proofing.DialogButtonEventArgs Class

The DialogButtonEventArgs class provides data for the TXSpellChecker.DialogButtonClicked event in TX Spell .NET for Windows Forms.

Introduced: 3.0.

Syntax

[C#]
public sealed class DialogButtonEventArgs
[Visual Basic]
Public NotInheritable Class DialogButtonEventArgs

Properties

Property | Description
DialogButton | Gets the clicked DialogButton.
StateManager | Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.


TXTextControl.Proofing.DialogButtonEventArgs.DialogButton Property

Gets the clicked DialogButton.

Syntax

[C#]
public Proofing.DialogButton DialogButton{ get; }
[Visual Basic]
Public ReadOnly Property DialogButton() As Proofing.DialogButton

Limitations

Read only.

>> TXTextControl.Proofing.DialogButtonEventArgs.StateManager Property


TXTextControl.Proofing.DialogButtonEventArgs.StateManager Property

Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.

Syntax

[C#]
public Proofing.SpellCheckDialogStateManager StateManager { get; }
[Visual Basic]
Public ReadOnly Property StateManager() As Proofing.SpellCheckDialogStateManager

Limitations

Read only.

<< TXTextControl.Proofing.DialogButtonEventArgs.DialogButton Property


TXTextControl.Proofing.Dictionary Class

The base class for all types of valid dictionaries is the abstract class Dictionary. The content of the dictionary is only accessed by the TXSpell.Dictionaries collection. The classes OpenOfficeDictionary and UserDictionary are inherited from the abstract class Dictionary.

Syntax

[C#]
public abstract class Dictionary
[Visual Basic]
Public MustInherit Class Dictionary

Properties

Property | Description
DictionaryEncoding | Gets or sets the dictionary's encoding.
IsGetSuggestionsEnabled | Gets or sets a value that indicates whether suggestions are created using this dictionary or not.
IsSelectedAsDefault | Gets a value indicating whether the dictionary is selected as the default dictionary by the Language property.
IsSpellCheckingEnabled | Gets or sets a value indicating whether spell checking of this dictionary is enabled or not.
Language | Gets or sets the dictionary's language.
Name | Gets or sets the dictionary's name.
ShowInOptionsDialog | Gets or sets a value indicating whether the dictionary is shown in the options dialog.


TXTextControl.Proofing.Dictionary.DictionaryEncoding Property

Gets or sets the dictionary's encoding.

Syntax

[C#]
public System.Text.Encoding DictionaryEncoding { get; set; }
[Visual Basic]
Public Property DictionaryEncoding() As System.Text.Encoding

>> TXTextControl.Proofing.Dictionary.IsGetSuggestionsEnabled Property


TXTextControl.Proofing.Dictionary.IsGetSuggestionsEnabled Property

Gets or sets a value that indicates whether suggestions are created using this dictionary or not. The default value is true.

Syntax

[C#]
public bool IsGetSuggestionsEnabled { get; set; }
[Visual Basic]
Public Property IsGetSuggestionsEnabled() As Boolean


TXTextControl.Proofing.Dictionary.IsSelectedAsDefault Property

Gets a value indicating whether the dictionary is selected as the default dictionary by the Language property. The default value is false.

Syntax

[C#]
public bool IsSelectedAsDefault { get; }
[Visual Basic]
Public ReadOnly Property IsSelectedAsDefault() As Boolean

Limitations

Read only.


TXTextControl.Proofing.Dictionary.IsSpellCheckingEnabled Property

Gets or sets a value indicating whether spell checking of this dictionary is enabled or not. The default value is true.

Syntax

[C#]
public bool IsSpellCheckingEnabled { get; set; }
[Visual Basic]
Public Property IsSpellCheckingEnabled() As Boolean


TXTextControl.Proofing.Dictionary.Language Property

Gets or sets the dictionary's language.

Introduced: 3.0.

Syntax

[C#]
public System.Globalization.CultureInfo Language { get; set; }
[Visual Basic]
Public Property Language() As System.Globalization.CultureInfo

Remarks

The property is automatically set, if the name of the dictionary file contains language specific information (e.g. "en_medical.txd" for English or "de_CH_frami.dic" for German (Switzerland)). Otherwise, the property returns null.


TXTextControl.Proofing.Dictionary.Name Property

Gets or sets the dictionary's name.

Syntax

[C#]
public string Name { get; set; }
[Visual Basic]
Public Property Name() As String


TXTextControl.Proofing.Dictionary.ShowInOptionsDialog Property

Gets or sets a value indicating whether the dictionary is shown in the options dialog. The default value is true.

Introduced: 8.0.

Syntax

[C#]
public bool ShowInOptionsDialog { get; set; }
[Visual Basic]
Public Property ShowInOptionsDialog() As Boolean

<< TXTextControl.Proofing.Dictionary.Name Property


TXTextControl.Proofing.DictionaryAddedEventArgs Class

The DictionaryAddedEventArgs class provides data for the TXSpellChecker.DictionaryAdded event in TX Spell .NET for Windows Forms and WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class DictionaryAddedEventArgs
[Visual Basic]
Public NotInheritable Class DictionaryAddedEventArgs

Properties

Property | Description
Dictionary | Gets the Dictionary which was added.


TXTextControl.Proofing.DictionaryAddedEventArgs.Dictionary Property

Gets the Dictionary which was added.

Syntax

[C#]
public Proofing.Dictionary Dictionary { get; }
[Visual Basic]
Public ReadOnly Property Dictionary() As Proofing.Dictionary

Limitations

Read only.


TXTextControl.Proofing.DictionaryCollection Class

An instance of the DictionaryCollection class contains all initialized dictionaries represented through objects which are inherited from the abstract class Dictionary. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference. TX Spell .NET provides the OpenOfficeDictionary and UserDictionary classes to create dictionaries that are compatible with the DictionaryCollection class.

Syntax

[C#]
public sealed class DictionaryCollection: CollectionBase, IEnumerable, IEnumerator
[Visual Basic]
Public NotInheritable Class DictionaryCollection
  Inherits CollectionBase
  Implements IEnumerable
  Implements IEnumerator

Properties

Property | Description
HasEditableUserDictionaries | Gets a value indicating whether the dictionary collection contains editable user dictionaries.
LoadDictionaryDelayed | Gets or sets a value indicating whether a dictionary is loaded on adding to the TXSpell.Dictionaries dictionary collection partially or not.

Methods

Method | Description
Add | Adds objects of the type Dictionary to the collection and validates them for spell checking and suggestion operations.
GetItem | Gets a particular dictionary from the collection by using the specified name.
Item | Gets a Dictionary from the collection.
Remove | Removes objects of the type Dictionary from the collection and invalidate them for spell checking and suggestion operations.


TXTextControl.Proofing.DictionaryCollection.Add Method

Adds objects of the type Dictionary to the collection and validates them for spell checking and suggestion operations.

Syntax

[C#]
public int Add(Proofing.Dictionary dictionary);
[Visual Basic]
Public Function Add(dictionary As Proofing.Dictionary) As Integer
Parameter | Description
dictionary | Specifies the dictionary.

Return Value

The collection index at which the dictionary has been added.

Remarks

This method throws an exception when called while the SpellCheckDialog is open (except for adding dictionaries of type UserDictionary when the built-in options dialog was invoked by a SpellCheckDialog's dialog button).

>> TXTextControl.Proofing.DictionaryCollection.GetItem Method


TXTextControl.Proofing.DictionaryCollection.GetItem Method

Gets a particular dictionary from the collection by using the specified name.

Syntax

[C#]
public Proofing.Dictionary GetItem(string name);
[Visual Basic]
Public Function GetItem(name As String) As Proofing.Dictionary
Parameter | Description
name | Specifies a dictionary name.

Return Value

The return value is null, if a dictionary with the specified name could not be found. Otherwise, it is an object of the type Dictionary.


TXTextControl.Proofing.DictionaryCollection.HasEditableUserDictionaries Property

Gets a value indicating whether the dictionary collection contains editable user dictionaries.

Introduced: 3.0.

Syntax

[C#]
public bool HasEditableUserDictionaries { get; }
[Visual Basic]
Public ReadOnly Property HasEditableUserDictionaries() As Boolean

Limitations

Read only.


TXTextControl.Proofing.DictionaryCollection.Item Property

Gets a Dictionary from the collection. This property is the indexer for the DictionaryCollection class.

Syntax

[C#]
public Proofing.Dictionary this [int number] { get; }
[Visual Basic]
Public Default ReadOnly Property Item(number As Integer) As Proofing.Dictionary
Parameter | Description
number | The zero-based index of the dictionary.

Return Value

The object of the type Dictionary at the specified index.

<< TXTextControl.Proofing.DictionaryCollection.HasEditableUserDictionaries Property | >> TXTextControl.Proofing.DictionaryCollection.LoadDictionaryDelayed Property


TXTextControl.Proofing.DictionaryCollection.LoadDictionaryDelayed Property

Gets or sets a value indicating whether a dictionary is loaded on adding to the TXSpell.Dictionaries dictionary collection partially or not. If the property is set to true, it is possible to spell check the text while the dictionary is still loading. In this case the spell checking text is slower than checking with completely loaded dictionaries. To get the full speed spell check performance the property needs to be set to false. The default value is false.

Introduced: 4.0.

Syntax

[C#]
public bool LoadDictionaryDelayed { get; set; }
[Visual Basic]
Public Property LoadDictionaryDelayed() As Boolean


TXTextControl.Proofing.DictionaryCollection.Remove Method

Removes objects of the type Dictionary from the collection and invalidate them for spell checking and suggestion operations.

Syntax

[C#]
public void Remove(Proofing.Dictionary dictionary);
[Visual Basic]
Public Sub Remove(dictionary As Proofing.Dictionary)
Parameter | Description
dictionary | Specifies the dictionary.

Remarks

This method throws an exception when called while the SpellCheckDialog is open (except for removing dictionaries of type UserDictionary when the built-in options dialog was invoked by a SpellCheckdialog's dialog button).

<< TXTextControl.Proofing.DictionaryCollection.LoadDictionaryDelayed Property


TXTextControl.Proofing.DictionaryRemovedEventArgs Class

The DictionaryRemovedEventArgs class provides data for the TXSpellChecker.DictionaryRemoved event in TXSpell for Windows Forms and WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class DictionaryRemovedEventArgs
[Visual Basic]
Public NotInheritable Class DictionaryRemovedEventArgs

Properties

Property | Description
Dictionary | Gets the Dictionary which was removed.


TXTextControl.Proofing.DictionaryRemovedEventArgs.Dictionary Property

Gets the Dictionary which was removed.

Syntax

[C#]
public Proofing.Dictionary Dictionary { get; }
[Visual Basic]
Public ReadOnly Property Dictionary() As Proofing.Dictionary

Limitations

Read only.


TXTextControl.Proofing.HyphenationList Class

The HyphenationList class represents a list of hyphenation rules that gets its content from a Hunspell Open Source hyphenation dictionary. As with all objects of type HyphenationList the content of that list is only accessed when the dictionary is added to the TXSpell.HyphenationLists collection. The first implementation loads a Hunspell Open Source hyphenation dictionary from a file that is defined by a dictionary path. Using the dictionary name only without a file path, the corresponding dictionary file of the default hyphenation list folder is used. The second constructor loads a hyphenation dictionary from string arrays that represent the content of a Hunspell Open Source hyphenation dictionary. It is recommended to create these arrays by using the encoding that is defined in the corresponding file represented by the encoding string in the first line. Using this implementation, it is also required to define the language of the dictionary by setting the System.Globalization.CultureInfo language parameter that sets the Proofing.HyphenationList.Language property automatically.

Introduced: 4.0.

Syntax

[C#]
public sealed class HyphenationList
[Visual Basic]
Public NotInheritable Class HyphenationList

Constructors

Constructor | Description
HyphenationList | Overloaded. Initializes a new instance of the HyphenationList class.

Properties

Property | Description
HyphenateCapitalizedWords | Gets or sets a value indicating whether words in uppercase will be hyphenated.
IsSelectedAsDefault | Gets a value indicating whether the hyphenation list is selected as the default hyphenation list by the HyphenationLanguage property.
Language | Gets or sets the hyphenation list's language.
MinCharsAtWordBegin | Specifies the minimum number of joined characters at the beginning of a hyphenated word.
MinCharsAtWordEnd | Specifies the minimum number of joined characters at the end of a hyphenated word.
MinSyllablesAfterCompoundHyphenationPoint | Specifies the minimum number of syllables behind a compound hyphenation point.
MinSyllablesBeforeCompoundHyphenationPoint | Specifies the minimum number of syllables before a compound hyphenation point.
Name | Gets or sets the hyphenation list's name.
UseOnlyCompoundHyphenationPoints | Gets or sets a value indicating whether words will be only hyphenated at compound junctions.


TXTextControl.Proofing.HyphenationList Constructor

Initializes a new instance of the HyphenationList class.

HyphenationList(String)

Initializes a new instance of the HyphenationList class by loading a Hunspell Open Source hyphenation dictionary from a file.

[C#]
public HyphenationList(string hyphenationListPath);
[Visual Basic]
Public Sub New(hyphenationListPath As String)
Parameter | Description
hyphenationListPath | Specifies the path for the Hunspell Open Source hyphenation dictionary dict file. By specifying only the the dictionary name without any file path, the corresponding hyphenation dictionary file of the default hyphenation list folder is used. The name of the specified Hunspell Open Source hyphenation dictionary file must start with "hyph_" and end with ".dic". If the file does not exist, an ArgumentException is thrown.

HyphenationList(String[], CultureInfo)

Initializes a new instance of the HyphenationList class by loading a hyphenation dictionary from string arrays that represent the content of a Hunspell Open Source hyphenation dictionary

[C#]
public HyphenationList(string[] hyphenationListLines, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub New(hyphenationListLines As String(), language As System.Globalization.CultureInfo)
Parameter | Description
hyphenationListLines | The string array that represents the content of a Hunspell Open Source hyphenation dictionary file. Each string of this array is considered as a line of the dictionary file.
language | Specifies the language of the hyphenation list.

>> TXTextControl.Proofing.HyphenationList.MinCharsAtWordBegin Property


TXTextControl.Proofing.HyphenationList.MinCharsAtWordBegin Property

Specifies the minimum number of joined characters at the beginning of a hyphenated word. The default value is 2.

Syntax

[C#]
public int MinCharsAtWordBegin { get; set; }
[Visual Basic]
Public Property MinCharsAtWordBegin() As Integer


TXTextControl.Proofing.HyphenationList.MinCharsAtWordEnd Property

Specifies the minimum number of joined characters at the end of a hyphenated word. The default value is 2.

Syntax

[C#]
public int MinCharsAtWordEnd { get; set; }
[Visual Basic]
Public Property MinCharsAtWordEnd() As Integer

<< TXTextControl.Proofing.HyphenationList.MinCharsAtWordBegin Property | >> TXTextControl.Proofing.HyphenationList.MinSyllablesAfterCompoundHyphenationPoint Property


TXTextControl.Proofing.HyphenationList.MinSyllablesAfterCompoundHyphenationPoint Property

Specifies the minimum number of syllables behind a compound hyphenation point. The default value is 1.

Syntax

[C#]
public int MinSyllablesAfterCompoundHyphenationPoint { get; set; }
[Visual Basic]
Public Property MinSyllablesAfterCompoundHyphenationPoint() As Integer

<< TXTextControl.Proofing.HyphenationList.MinCharsAtWordEnd Property | >> TXTextControl.Proofing.HyphenationList.MinSyllablesBeforeCompoundHyphenationPoint Property


TXTextControl.Proofing.HyphenationList.MinSyllablesBeforeCompoundHyphenationPoint Property

Specifies the minimum number of syllables before a compound hyphenation point. The default value is 1.

Syntax

[C#]
public int MinSyllablesBeforeCompoundHyphenationPoint { get; set; }
[Visual Basic]
Public Property MinSyllablesBeforeCompoundHyphenationPoint() As Integer

<< TXTextControl.Proofing.HyphenationList.MinSyllablesAfterCompoundHyphenationPoint Property | >> TXTextControl.Proofing.HyphenationList.IsSelectedAsDefault Property


TXTextControl.Proofing.HyphenationList.IsSelectedAsDefault Property

Gets a value indicating whether the hyphenation list is selected as the default hyphenation list by the HyphenationLanguage property. The default value is false.

Syntax

[C#]
public bool IsSelectedAsDefault { get; }
[Visual Basic]
Public ReadOnly Property IsSelectedAsDefault() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.HyphenationList.MinSyllablesBeforeCompoundHyphenationPoint Property | >> TXTextControl.Proofing.HyphenationList.UseOnlyCompoundHyphenationPoints Property


TXTextControl.Proofing.HyphenationList.UseOnlyCompoundHyphenationPoints Property

Gets or sets a value indicating whether words will be only hyphenated at compound junctions. The default value is false.

Syntax

[C#]
public bool UseOnlyCompoundHyphenationPoints { get; set; }
[Visual Basic]
Public Property UseOnlyCompoundHyphenationPoints() As Boolean

<< TXTextControl.Proofing.HyphenationList.IsSelectedAsDefault Property | >> TXTextControl.Proofing.HyphenationList.HyphenateCapitalizedWords Property


TXTextControl.Proofing.HyphenationList.HyphenateCapitalizedWords Property

Gets or sets a value indicating whether words in uppercase will be hyphenated. The default value is true.

Syntax

[C#]
public bool HyphenateCapitalizedWords { get; set; }
[Visual Basic]
Public Property HyphenateCapitalizedWords() As Boolean


TXTextControl.Proofing.HyphenationList.Language Property

Gets or sets the hyphenation list's language.

Syntax

[C#]
public System.Globalization.CultureInfo Language { get; set; }
[Visual Basic]
Public Property Language() As System.Globalization.CultureInfo

Remarks

The property is automatically set, if the name of the hyphenation dictionary file contains language specific information (e.g. "hyph_en.dic" for English or "hyph_de_CH.dic" for German (Switzerland)). Otherwise, the property returns null.


TXTextControl.Proofing.HyphenationList.Name Property

Gets or sets the hyphenation list's name.

Syntax

[C#]
public string Name { get; set; }
[Visual Basic]
Public Property Name() As String

<< TXTextControl.Proofing.HyphenationList.Language Property


TXTextControl.Proofing.HyphenationListCollection Class

An instance of the HyphenationListCollection class contains all objects of type HyphenationList that can be used to create hyphenations. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference.

Introduced: 4.0.

Syntax

[C#]
public sealed class HyphenationListCollection: CollectionBase, IEnumerable, IEnumerator
[Visual Basic]
Public NotInheritable Class HyphenationListCollection
  Inherits CollectionBase
  Implements IEnumerable
  Implements IEnumerator

Methods

Method | Description
Add | Adds objects of the type HyphenationList to the collection.
GetItem | Gets a particular HyphenationList from the collection by using the specified name.
Item | Gets an object of type HyphenationList from the collection.
Remove | Removes objects of the type HyphenationList from the collection.


TXTextControl.Proofing.HyphenationListCollection.Add Method

Adds objects of the type HyphenationList to the collection.

Syntax

[C#]
public int Add(Proofing.HyphenationList hyphenationList);
[Visual Basic]
Public Function Add(hyphenationList As Proofing.HyphenationList) As Integer
Parameter | Description
hyphenationList | Specifies the HyphenationList.

Return Value

The collection index at which the HyphenationList has been added.

>> TXTextControl.Proofing.HyphenationListCollection.GetItem Method


TXTextControl.Proofing.HyphenationListCollection.GetItem Method

Gets a particular HyphenationList from the collection by using the specified name.

Syntax

[C#]
public Proofing.HyphenationList GetItem(string name);
[Visual Basic]
Public Function GetItem(name As String) As Proofing.HyphenationList
Parameter | Description
name | Specifies a hyphenation list name.

Return Value

The return value is null, if a HyphenationList with the specified name could not be found. Otherwise, it is an object of the type HyphenationList.


TXTextControl.Proofing.HyphenationListCollection.Item Property

Gets an object of type HyphenationList from the collection. This property is the indexer for the HyphenationListCollection class.

Syntax

[C#]
public Proofing.HyphenationList this [int number] { get; }
[Visual Basic]
Public Default ReadOnly Property Item(number As Integer) As Proofing.HyphenationList
Parameter | Description
number | The zero-based index of the HyphenationList.

Return Value

The object of the type HyphenationList at the specified index.


TXTextControl.Proofing.HyphenationListCollection.Remove Method

Removes objects of the type HyphenationList from the collection.

Syntax

[C#]
public void Remove(Proofing.HyphenationList hyphenationList);
[Visual Basic]
Public Sub Remove(hyphenationList As Proofing.HyphenationList)
Parameter | Description
hyphenationList | Specifies the HyphenationList.

<< TXTextControl.Proofing.HyphenationListCollection.Item Property


TXTextControl.Proofing.IncorrectWord Class

The IncorrectWord class represents an incorrect word in a text. It is inherited from the abstract class SpelledWord.

Syntax

[C#]
public sealed class IncorrectWord : Proofing.SpelledWord
[Visual Basic]
Public NotInheritable Class IncorrectWord
  Inherits Proofing.SpelledWord

Properties

Property | Description
Index | Gets the index of the spelled word to the corresponding collection. (Inherited from Proofing.SpelledWord.)
IsDuplicate | Gets a value indicating whether the spelled word is declared as incorrect, because the previous word has the same text.
Language | Gets a value indicating the language the incorrect word was spelled.
Length | Gets the length of the spelled word. (Inherited from Proofing.SpelledWord.)
Start | Gets the starting position of a spelled word. (Inherited from Proofing.SpelledWord.)
Text | Gets the text of the spelled word. (Inherited from Proofing.SpelledWord.)


TXTextControl.Proofing.IncorrectWord.IsDuplicate Property

Gets a value indicating whether the spelled word is declared as incorrect, because the previous word has the same text.

Syntax

[C#]
public bool IsDuplicate { get; }
[Visual Basic]
Public ReadOnly Property IsDuplicate As Boolean

Limitations

Read only.

>> TXTextControl.Proofing.IncorrectWord.Language Property


TXTextControl.Proofing.IncorrectWord.Language Property

Gets a value indicating the language the incorrect word was spelled. If no specific language was defined, the property returns null.

Syntax

[C#]
public System.Globalization.CultureInfo  Language { get; }
[Visual Basic]
Public ReadOnly Property Language As System.Globalization.CultureInfo

Limitations

Read only.

<< TXTextControl.Proofing.IncorrectWord.IsDuplicate Property


TXTextControl.Proofing.IncorrectWordChangingEventArgs Class

The IncorrectWordChangingEventArgs class provides data for the TXSpellChecker.IncorrectWordChanging event in TX Spell .NET for Windows Forms and WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class IncorrectWordChangingEventArgs
[Visual Basic]
Public NotInheritable Class IncorrectWordChangingEventArgs

Properties

Property | Description
Cancel | Get or sets a value indicating whether the changing operation for the current incorrect word should be canceled.
CorrectedText | Gets the complete text including the replaced incorrect words with the corrected words.
CorrectedWord | Gets or sets the new word that replaces the text of the incorrect word.
IncorrectWord | Gets the incorrect word that is changed.
SourceText | Gets the complete text without the replaced incorrect words.
Type | Gets the type that defines how the incorrect word is changed.
WillBeDuplicate | Gets a value specifying whether replacing the text of the current incorrect word would result in a conversion to a duplicate incorrect word.


TXTextControl.Proofing.IncorrectWordChangingEventArgs.Cancel Method

Get or sets a value indicating whether the changing operation for the current incorrect word should be canceled.

Introduced: 6.0.

Syntax

[C#]
public bool Cancel { get; set; }
[Visual Basic]
>Public Property Cancel() As Boolean

>> TXTextControl.Proofing.IncorrectWordChangingEventArgs.CorrectedWord Property


TXTextControl.Proofing.IncorrectWordChangingEventArgs.CorrectedWord Property

Gets or sets the new word that replaces the text of the incorrect word.

Syntax

[C#]
public string CorrectedWord { get; set; }
[Visual Basic]
Public Property CorrectedWord() As String

Remarks

This property returns an exception, if the current IncorrectWordChangingEventArgs.Type property is not type of Replace.

<< TXTextControl.Proofing.IncorrectWordChangingEventArgs.Cancel Method | >> TXTextControl.Proofing.IncorrectWordChangingEventArgs.CorrectedText Property


TXTextControl.Proofing.IncorrectWordChangingEventArgs.CorrectedText Property

Gets the complete text including the replaced incorrect words with the corrected words.

Syntax

[C#]
public string CorrectedText{ get; }
[Visual Basic]
Public ReadOnly Property CorrectedText() As String

Limitations

Read only.

<< TXTextControl.Proofing.IncorrectWordChangingEventArgs.CorrectedWord Property | >> TXTextControl.Proofing.IncorrectWordChangingEventArgs.IncorrectWord Property


TXTextControl.Proofing.IncorrectWordChangingEventArgs.IncorrectWord Property

Gets the incorrect word that is changed.

Syntax

[C#]
public Proofing.IncorrectWord IncorrectWord { get; }
[Visual Basic]
Public ReadOnly Property IncorrectWord() As Proofing.IncorrectWord

Limitations

Read only.

<< TXTextControl.Proofing.IncorrectWordChangingEventArgs.CorrectedText Property | >> TXTextControl.Proofing.IncorrectWordChangingEventArgs.SourceText Property


TXTextControl.Proofing.IncorrectWordChangingEventArgs.SourceText Property

Gets the complete text without the replaced incorrect words.

Syntax

[C#]
public string SourceText{ get; }
[Visual Basic]
Public ReadOnly Property SourceText() As String

Limitations

Read only.

<< TXTextControl.Proofing.IncorrectWordChangingEventArgs.IncorrectWord Property | >> TXTextControl.Proofing.IncorrectWordChangingEventArgs.Type Property


TXTextControl.Proofing.IncorrectWordChangingEventArgs.Type Property

Gets the type that defines how the incorrect word is changed.

Syntax

[C#]
public Proofing.TXSpell.ChangeType Type{ get; }
[Visual Basic]
Public ReadOnly Property Type() As Proofing.TXSpell.ChangeType

Limitations

Read only.

<< TXTextControl.Proofing.IncorrectWordChangingEventArgs.SourceText Property | >> TXTextControl.Proofing.IncorrectWordChangingEventArgs.WillBeDuplicate Property


TXTextControl.Proofing.IncorrectWordChangingEventArgs.WillBeDuplicate Property

Gets a value specifying whether replacing the text of the current incorrect word would result in a conversion to a duplicate incorrect word.

Syntax

[C#]
public bool WillBeDuplicate{ get; }
[Visual Basic]
Public ReadOnly Property WillBeDuplicate() As Boolean

Remarks

This property returns an exception, if the current IncorrectWordChangingEventArgs.Type property is not type of Replace.

Limitations

Read only.

<< TXTextControl.Proofing.IncorrectWordChangingEventArgs.Type Property


TXTextControl.Proofing.IncorrectWordCollection Class

An instance of the IncorrectWordCollection class contains objects of the type IncorrectWord. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference.

Syntax

[C#]
public sealed class IncorrectWordCollection: CollectionBase, IEnumerable, IEnumerator
[Visual Basic]
Public NotInheritable Class IncorrectWordCollection
  Inherits CollectionBase
  Implements IEnumerable
  Implements IEnumerator

Methods

Method | Description
Item | Gets an incorrect word from the collection.


TXTextControl.Proofing.IncorrectWordCollection.Item Property

Gets an incorrect word from the collection. This property is the indexer for the IncorrectWordCollection class.

Syntax

[C#]
public Proofing.IncorrectWord this [int number] { get; }
[Visual Basic]
Public Default ReadOnly Property Item(number As Integer) As Proofing.IncorrectWord
Parameter | Description
number | The zero-based index of the incorrect word.

Return Value

The object of type IncorrectWord at the specified index.


TXTextControl.Proofing.LanguageScope Class

The LanguageScope class represents a text scope with a specific language.

Introduced: 5.0.

Syntax

[C#]
public sealed class LanguageScope
[Visual Basic]
Public NotInheritable Class LanguageScope

Properties

Property | Description
Index | Gets the index of the language scope to the corresponding collection.
Language | Gets the culture of the language scope.
Length | Gets the length of the language scope.
Start | Gets the starting position of a language scope.


TXTextControl.Proofing.LanguageScope.Index Property

Gets the index of the language scope to the corresponding collection. The first scope has the index 0.

Syntax

[C#]
public int Index { get; }
[Visual Basic]
Public ReadOnly Property Index() As Integer

Limitations

Read only.

>> TXTextControl.Proofing.LanguageScope.Language Property


TXTextControl.Proofing.LanguageScope.Language Property

Gets the culture of the language scope.

Syntax

[C#]
public CultureInfo Language { get; }
[Visual Basic]
Public ReadOnly Property Language() As CultureInfo

Remarks

If no language was detected for the scope the property returns null.

Limitations

Read only.


TXTextControl.Proofing.LanguageScope.Length Property

Gets the length of the language scope.

Syntax

[C#]
public int Length { get; }
[Visual Basic]
Public ReadOnly Property Length() As Integer

Limitations

Read only.


TXTextControl.Proofing.LanguageScope.Start Property

Gets the starting position of a language scope. It is a zero-based index of the word's first character.

Syntax

[C#]
public int Start { get; }
[Visual Basic]
Public ReadOnly Property Start() As Integer

Limitations

Read only.

<< TXTextControl.Proofing.LanguageScope.Length Property


TXTextControl.Proofing.LanguageScopeCollection Class

An instance of the LanguageScopeCollection class contains all detected language scopes for a specific text. These language scopes are represented through objects of type LanguageScope. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference.

Introduced: 5.0.

Syntax

[C#]
public sealed class LanguageScopeCollection: CollectionBase, IEnumerable, IEnumerator
[Visual Basic]
Public NotInheritable Class LanguageScopeCollection
  Inherits CollectionBase
  Implements IEnumerable
  Implements IEnumerator

Methods

Method | Description
GetItem | Overloaded. Gets a particular item from the collection.
Item | Gets an object of type LanguageScope from the collection.


TXTextControl.Proofing.LanguageScopeCollection.GetItem Method

Gets a particular item from the collection.

GetItem(Int32)

Gets the language scope at the specified text input position.

[C#]
public Proofing.LanguageScope GetItem(int textPosition);
[Visual Basic]
Public Function GetItem(ByVal textPosition As Integer) As Proofing.LanguageScope
Parameter | Description
textPosition | Specifies a zero-based text postion.

GetItem(Int32, CultureInfo)

Gets the language scope of the specified language at the specified text input position. If the language scope's culture at that position does not equal to the specified languge, the next corresponding scope is returned. If there is no language scope of the specified language between the specified input position and the end of the text, the first language scope of the specified kind is returned.

[C#]
public Proofing.LanguageScope GetItem(int textPosition, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function GetItem(ByVal textPosition As Integer, language As System.Globalization.CultureInfo) As Proofing.LanguageScope
Parameter | Description
textPosition | Specifies a zero-based text postion.
language | Specifies the language to search for.

Return Value

The return value is null, if a language scope could not be found. Otherwise, it is an object of the type LanguageScope.

>> TXTextControl.Proofing.LanguageScopeCollection.Item Property


TXTextControl.Proofing.LanguageScopeCollection.Item Property

Gets an object of type LanguageScope from the collection. This property is the indexer for the LanguageScopeCollection class.

Syntax

[C#]
public Proofing.LanguageScope this [int number] { get; }
[Visual Basic]
Public Default ReadOnly Property Item(number As Integer) As Proofing.LanguageScope
Parameter | Description
number | The zero-based index of the LanguageScope.

Return Value

The object of the type LanguageScope at the specified index.

<< TXTextControl.Proofing.LanguageScopeCollection.GetItem Method


TXTextControl.Proofing.MenuItem Class

The MenuItem class provides the possibility to build a menu strip with the most common TX Spell .NET features. An array of these items is created by calling the TXSpellChecker.GetMenuItems method. Clicking a MenuItem results in a specific action that depends on the Proofing.MenuItem.Type Property. The class is inherited from the System.Windows.Forms.ToolStripMenuItem class.

Introduced: 3.0.

Syntax

[C#]
public sealed class MenuItem
[Visual Basic]
Public NotInheritable Class MenuItem

Properties

Property | Description
Type | Gets the type of the MenuItem.


TXTextControl.Proofing.MenuItem.Type Property

Gets the type of the MenuItem.

Syntax

[C#]
public Proofing.TXSpell.MenuItemType Type { get; }
[Visual Basic]
Public ReadOnly Property Type() As Proofing.TXSpell.MenuItemType

Limitations

Read only.


TXTextControl.Proofing.MenuItemClickedEventArgs Class

The MenuItemClickedEventArgs class provides data for the TXSpellChecker.MenutItemClicked event in TX Spell .NET for Windows Forms.

Introduced: 3.0.

Syntax

[C#]
public sealed class MenuItemClickedEventArgs
[Visual Basic]
Public NotInheritable Class MenuItemClickedEventArgs

Properties

Property | Description
MenuItem | Gets the clicked MenuItem.


TXTextControl.Proofing.MenuItemClickedEventArgs.MenuItem Property

Gets the clicked MenuItem.

Syntax

[C#]
public Proofing.MenuItem MenuItem { get; }
[Visual Basic]
Public ReadOnly Property MenuItem() As Proofing.MenuItem

Limitations

Read only.


TXTextControl.Proofing.MisspelledWordChangingEventArgs Class

The MisspelledWordChangingEventArgs class provides data for the TXSpellChecker.MisspelledWordChanging event in TXSpell for Windows Forms and WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class MisspelledWordChangingEventArgs
[Visual Basic]
Public NotInheritable Class MisspelledWordChangingEventArgs

Properties

Property | Description
Cancel | Get or sets a value indicating whether the changing operation for the current misspelled word should be canceled.
CorrectedWord | Gets or sets the new word that replaces the text of an object of type TXTextControl.MisspelledWord.
IFormattedText | Gets the object of type TXTextControl.IFormattedText where the object of type TXTextControl.MisspelledWord is changed.
MisspelledWord | Gets the object of type TXTextControl.MisspelledWord that is changed.
Type | Gets the type that defines how the object of type TXTextControl.MisspelledWord is changed.
WillBeDuplicate | Gets a value specifying whether replacing the text of the current misspelled word would result in a conversion to a duplicate misspelled word.


TXTextControl.Proofing.MisspelledWordChangingEventArgs.Cancel Property

Get or sets a value indicating whether the changing operation for the current misspelled word should be canceled.

Introduced: 6.0.

Syntax

[C#]
public bool Cancel { get; set; }
[Visual Basic]
>Public Property Cancel() As Boolean

>> TXTextControl.Proofing.MisspelledWordChangingEventArgs.CorrectedWord Property


TXTextControl.Proofing.MisspelledWordChangingEventArgs.CorrectedWord Property

Gets or sets the new word that replaces the text of an object of type TXTextControl.MisspelledWord.

Syntax

[C#]
public string CorrectedWord { get; set; }
[Visual Basic]
Public Property CorrectedWord() As String

Remarks

That property returns an exception, if the current MisspelledWordChangingEventArgs.Type property is not type of Replace.

<< TXTextControl.Proofing.MisspelledWordChangingEventArgs.Cancel Property | >> TXTextControl.Proofing.MisspelledWordChangingEventArgs.IFormattedText Property


TXTextControl.Proofing.MisspelledWordChangingEventArgs.IFormattedText Property

Gets the object of type TXTextControl.IFormattedText where the object of type TXTextControl.MisspelledWord is changed.

Syntax

[C#]
public object IFormattedText { get; }
[Visual Basic]
Public ReadOnly Property IFormattedText() As Object

Limitations

Read only.

<< TXTextControl.Proofing.MisspelledWordChangingEventArgs.CorrectedWord Property | >> TXTextControl.Proofing.MisspelledWordChangingEventArgs.MisspelledWord Property


TXTextControl.Proofing.MisspelledWordChangingEventArgs.MisspelledWord Property

Gets the object of type TXTextControl.MisspelledWord that is changed.

Syntax

[C#]
public object MisspelledWord { get; }
[Visual Basic]
Public ReadOnly Property MisspelledWord() As Object

Limitations

Read only.

<< TXTextControl.Proofing.MisspelledWordChangingEventArgs.IFormattedText Property | >> TXTextControl.Proofing.MisspelledWordChangingEventArgs.Type Property


TXTextControl.Proofing.MisspelledWordChangingEventArgs.Type Property

Gets the type that defines how the object of type TXTextControl.MisspelledWord is changed.

Syntax

[C#]
public Proofing.TXSpell.ChangeType Type{ get; }
[Visual Basic]
Public ReadOnly Property Type() As Proofing.TXSpell.ChangeType

Limitations

Read only.

<< TXTextControl.Proofing.MisspelledWordChangingEventArgs.MisspelledWord Property | >> TXTextControl.Proofing.MisspelledWordChangingEventArgs.WillBeDuplicate Property


TXTextControl.Proofing.MisspelledWordChangingEventArgs.WillBeDuplicate Property

Gets a value specifying whether replacing the text of the current misspelled word would result in a conversion to a duplicate misspelled word.

Syntax

[C#]
public bool WillBeDuplicate{ get; }
[Visual Basic]
Public ReadOnly Property WillBeDuplicate() As Boolean

Remarks

This property returns an exception, if the current MisspelledWordChangingEventArgs.Type property is not type of Replace.

This property returns false, if used in combinatation with TXTextControl version 17.0.

Limitations

Read only.

<< TXTextControl.Proofing.MisspelledWordChangingEventArgs.Type Property


TXTextControl.Proofing.OpenOfficeDictionary Class

The OpenOfficeDictionary class represents a dictionary that gets its content from a Hunspell Open Source dictionary. As with all dictionaries of type Dictionary, the content of the dictionary is only accessed when the dictionary is added to the TXSpell.Dictionaries collection. The first implementation loads a Hunspell Open Source dictionary from a file that is defined by a dictionary path. Using the dictionary name only without a file path, the corresponding dictionary file of the default dictionary folder is used. The second constructor loads a dictionary from string arrays that represent the content of a Hunspell Open Source dictionary and the corresponding affix file. It is recommended to create these arrays by using the encoding that is defined in the corresponding affix file represented by the "SET"-Flag. Using this implementation, it is also required to define the language of the dictionary by setting the System.Globalization.CultureInfo language parameter that sets the Proofing.Dictionary.Language property automatically. It is inherited from the abstract class Dictionary.

Syntax

[C#]
public sealed class OpenOfficeDictionary : Dictionary
[Visual Basic]
Public NotInheritable Class OpenOfficeDictionary
  Inherits Dictionary

Constructors

Constructor | Description
OpenOfficeDictionary | Overloaded. Initializes a new instance of the OpenOfficeDictionary class.

Properties

Property | Description
DictionaryEncoding | Gets or sets the dictionary's encoding. (Inherited from Proofing.Dictionary.)
IsGetSuggestionsEnabled | Gets or sets a value that indicates whether suggestions are created using this dictionary or not. (Inherited from Proofing.Dictionary.)
IsSelectedAsDefault | Gets a value indicating whether the dictionary is selected as the default dictionary by the Language property. (Inherited from Proofing.Dictionary.)
IsSpellCheckingEnabled | Gets or sets a value indicating whether spell checking of this dictionary is enabled or not. (Inherited from Proofing.Dictionary.)
Language | Gets or sets the dictionary's language. (Inherited from Proofing.Dictionary.)
Name | Gets or sets the dictionary's name. (Inherited from Proofing.Dictionary.)
ShowInOptionsDialog | Gets or sets a value indicating whether the dictionary is shown in the options dialog. (Inherited from Proofing.Dictionary.)


TXTextControl.Proofing.OpenOfficeDictionary Constructor

Initializes a new instance of the OpenOfficeDictionary class.

OpenOfficeDictionary(String)

Initializes a new instance of the OpenOfficeDictionary class by loading a Hunspell Open Source dictionary from a file.

[C#]
public OpenOfficeDictionary(string dictionaryPath);
[Visual Basic]
Public Sub New(dictionaryPath As String)
Parameter | Description
dictionaryPath | Specifies the path for the Hunspell Open Source dictionary dict file. By specifying only the dictionary name without any file path, the corresponding dictionary file of the default dictionary folder is used. The name of the specified Hunspell Open Source dictionary file must end with ".dic" or ".aff". If the file does not exist, an ArgumentException is thrown.

OpenOfficeDictionary(String[], String[], CultureInfo)

Initializes a new instance of the OpenOfficeDictionary class by loading a dictionary from string arrays that represent the content of a Hunspell Open Source dictionary and the corresponding affix file.

[C#]
public OpenOfficeDictionary(string[] dictionaryLines, string[] affixLines, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub New(dictionaryLines As String(), affixLines As String(), language As System.Globalization.CultureInfo)
Parameter | Description
dictionaryLines | The string array that represents the content of a Hunspell Open Source dictionary file. Each string of this array is considered as a line of the dictionary file.
affixLines | The string array that represents the content of a Hunspell Open Source affix file. Each string of this array is considered as a line of the affix file.
language | Specifies the language of the dictionary.


TXTextControl.Proofing.OptionsDialogOpeningEventArgs Class

The OptionsDialogOpeningEventArgs class provides data for the TXSpellChecker.OptionsDialogOpening event in TXSpell for Windows Forms.

Introduced: 3.0.

Syntax

[C#]
public sealed class OptionsDialogOpeningEventArgs
[Visual Basic]
Public Sealed Class OptionsDialogOpeningEventArgs

Properties

Property | Description
Cancel | Gets or sets a value indicating whether the event is canceled or not.


TXTextControl.Proofing.OptionsDialogOpeningEventArgs.Cancel Property

Gets or sets a value indicating whether the event is canceled or not.

Syntax

[C#]
public bool Cancel { get; set; }
[Visual Basic]
Public Property Cancel() As Boolean


TXTextControl.Proofing.Preview Class

The Preview class describes and handles attributes of the SpellCheckDialog's preview component. An instance of this class is provided by the SpellCheckDialog.Preview property in TX Spell .NET for Windows Forms.

Introduced: 3.0.

Syntax

[C#]
public sealed class Preview
[Visual Basic]
Public NotInheritable Class Preview

Properties

Property | Description
Editable | Gets or sets the value specifying whether the SpellCheckDialog preview component is editable or not.
IncorrectWordColor | Gets or sets the color to colorize the current incorrect or misspelled (TXTextControl.MisspelledWord) word inside the SpellCheckDialog preview component.


TXTextControl.Proofing.Preview.Editable Property

Gets or sets the value specifying whether the SpellCheckDialog preview component is editable or not. The default value is true.

Syntax

[C#]
public bool Editable { get; set; }
[Visual Basic]
Public Property Editable() As Boolean

>> TXTextControl.Proofing.Preview.IncorrectWordColor Property


TXTextControl.Proofing.Preview.IncorrectWordColor Property

Gets or sets the color to colorize the current incorrect or misspelled (TXTextControl.MisspelledWord) word inside the SpellCheckDialog preview component. The default value is System.Drawing.Color.Red.

Syntax

[C#]
public System.Drawing.Color IncorrectWordColor { get; set; }
[Visual Basic]
Public Property IncorrectWordColor() As System.Drawing.Color

<< TXTextControl.Proofing.Preview.Editable Property


TXTextControl.Proofing.ShowDialogSettings Class

The ShowDialogSettings class provides the possibility to determine the start position and the owner of the built-in options or spell check dialog. To specify these settings for the spell check dialog, the TXSpellChecker.SpellChecker.ShowDialogSettings property is provided. The options dialog can be modified by setting an instance of the ShowDialogSettings class as a parameter to the OptionsDialog method.

Introduced: 9.0.

Syntax

[C#]
public class ShowDialogSettings
[Visual Basic]
Public Class ShowDialogSettings

Properties

Property | Description
Location | Defines the starting location of the dialog if the StartPosition property is set to TXSpell.DialogStartPosition.Manual.
Owner | Gets or sets the IWin32Window that represents the top-level window that will own the dialog form.
StartPosition | Gets or sets the starting position of the form at run time.


TXTextControl.Proofing.ShowDialogSettings.Location Property

Defines the starting location of the dialog if the StartPosition property is set to TXSpell.DialogStartPosition.Manual. The default value is System.Drawing.Point.Empty

Syntax

[C#]
public System.Drawing.Point Location { get; set; }
[Visual Basic]
Public Property Location() As System.Drawing.Point

>> TXTextControl.Proofing.ShowDialogSettings.Owner Property


TXTextControl.Proofing.ShowDialogSettings.Owner Property

Gets or sets the IWin32Window that represents the top-level window that will own the dialog form. The default value is null.

Syntax

[C#]
public System.Windows.Forms.IWin32Window Owner { get; set; }
[Visual Basic]
Public Property Owner() As System.Windows.Forms.IWin32Window


TXTextControl.Proofing.ShowDialogSettings.StartPosition Property

Gets or sets the starting position of the form at run time. The default value is TXSpell.DialogStartPosition.CenterScreen.

Syntax

[C#]
public TXSpell.DialogStartPosition StartPosition { get; set; }
[Visual Basic]
Public Property StartPosition() As TXSpell.DialogStartPosition

<< TXTextControl.Proofing.ShowDialogSettings.Owner Property


TXTextControl.Proofing.SpellCheckDialog Class

The SpellCheckDialog class provides the possibility to modify and show the built-in spell check dialog.

Introduced: 3.0.

Syntax

[C#]
public sealed class SpellCheckDialog
[Visual Basic]
Public NotInheritable Class SpellCheckDialog

Properties

Property | Description
AcceptButton | Gets or sets the dialog button that is used as the SpellCheckDialog's accept button.
ChangeButtons | Gets a collection of all dialog buttons that are located to the right of the SpellCheckDialog's suggestions list.
ChangeInAllTextParts | Gets or sets a value indicating whether the SpellCheckDialog change operation is applied in all text parts (TXTextControl.TextControl.TextParts).
CloseOnFinished | Gets or sets a value specifying whether the SpellCheckDialog is closed on completing the spell checking.
Font | Gets or sets the font for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.
HideSelection | Gets or sets a value indicating whether the selected text in the TXTextControl.TextControl remains highlighted while the SpellCheckDialog is open.
IgnoreButtons | Gets a collection of all dialog buttons that are located to the right of the SpellCheckDialog's preview component.
IgnoreInAllTextParts | Gets or sets a value indicating whether the SpellCheckDialog ignore operation should be applied in all text parts (TXTextControl.TextControl.TextParts).
Location | Returns the point that represents the upper-left corner of the SpellCheckDialog form in screen coordinates.
OptionButtons | Gets a collection of all dialog buttons that are located below the SpellCheckDialog's suggestion dictionary combo box.
Preview | Gets the SpellCheckDialog's Preview instance.
ShowDialogSettings | Gets or sets an instance of the ShowDialogSettings class to determine the SpellCheckDialog form's start position and owner.
ShowMessageBoxes | Gets or sets a value indicating whether the dialog should invoke built-in message boxes that informs the user that the spell checking was completed or that a chosen word was not found in one of the suggestion dictionaries.
SuggestionDictionaryComboBox | Gets the SpellCheckDialog's SuggestionDictionaryComboBox instance.
SuggestionList | Gets the SpellCheckDialog's SuggestionList instance.

Methods

Method | Description
Show | Overloaded. Invokes the built-in dialog box for checking incorrect or misspelled (TXTextControl.TextControl.MisspelledWords) words.


TXTextControl.Proofing.SpellCheckDialog.AcceptButton Property

Gets or sets the dialog button that is used as the SpellCheckDialog's accept button. The default value is the Ignore Once button.

Syntax

[C#]
public Proofing.DialogButton AcceptButton { get; set; }
[Visual Basic]
Public Property AcceptButton() As Proofing.DialogButton

>> TXTextControl.Proofing.SpellCheckDialog.ChangeInAllTextParts Property


TXTextControl.Proofing.SpellCheckDialog.ChangeInAllTextParts Property

Gets or sets a value indicating whether the SpellCheckDialog change operation is applied in all text parts (TXTextControl.TextControl.TextParts). The default value is true.

Syntax

[C#]
public bool ChangeInAllTextParts { get; set; }
[Visual Basic]
Public Property ChangeInAllTextParts() As Boolean

Remarks

This parameter is only executable, if the SpellCheckDialog is connected to an object of type TXTextControl.TextControl.


TXTextControl.Proofing.SpellCheckDialog.CloseOnFinished Property

Gets or sets a value specifying whether the SpellCheckDialog is closed on completing the spell checking. The default value is true.

Syntax

[C#]
public bool CloseOnFinished { get; set; }
[Visual Basic]
Public Property CloseOnFinished() As Boolean


TXTextControl.Proofing.SpellCheckDialog.Font Property

Gets or sets the font for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button. The default is the value of the System.Windows.Forms.Control.DefaultFont property.

Syntax

[C#]
public System.Drawing.Font Font { get; set; }
[Visual Basic]
Public Property Font() As public System.Drawing.Font


TXTextControl.Proofing.SpellCheckDialog.HideSelection Property

Gets or sets a value indicating whether the selected text in the TXTextControl.TextControl remains highlighted while the SpellCheckDialog is open. The default value is false.

Syntax

[C#]
public bool HideSelection { get; set; }
[Visual Basic]
Public Property HideSelection() As Boolean

Remarks

This parameter is only executable, if the SpellCheckDialog is connected to an object of type TXTextControl.TextControl.


TXTextControl.Proofing.SpellCheckDialog.IgnoreInAllTextParts Property

Gets or sets a value indicating whether the SpellCheckDialog ignore operation should be applied in all text parts (TXTextControl.TextControl.TextParts). The default value is true.

Syntax

[C#]
public bool IgnoreInAllTextParts { get; set; }
[Visual Basic]
Public Property IgnoreInAllTextParts() As Boolean

Remarks

This parameter is only executable, if the SpellCheckDialog is connected to an object of type TXTextControl.TextControl.


TXTextControl.Proofing.SpellCheckDialog.Location Property

Returns the point that represents the upper-left corner of the SpellCheckDialog form in screen coordinates.

Introduced: 9.0.

Syntax

[C#]
public System.Drawing.Point Location { get; }
[Visual Basic]
Public ReadOnly Property Location() As System.Drawing.Point

Remarks

The property returns System.Drawing.Point.Empty, if the dialog was not shown yet.

Limitations

Read only.


TXTextControl.Proofing.SpellCheckDialog.ShowDialogSettings Property

Gets or sets an instance of the ShowDialogSettings class to determine the SpellCheckDialog form's start position and owner.

Introduced: 9.0.

Syntax

[C#]
public Proofing.ShowDialogSettings ShowDialogSettings{ get; }
[Visual Basic]
Public ReadOnly Property ShowDialogSettings() As Proofing.ShowDialogSettings


TXTextControl.Proofing.SpellCheckDialog.OptionButtons Property

Gets a collection of all dialog buttons that are located below the SpellCheckDialog's suggestion dictionary combo box. The property's value is an object of type DialogButtonCollection and can be modified by using its methods and properties. The default content of that collection is a button of type Options.

Syntax

[C#]
public Proofing.DialogButtonCollection OptionButtons{ get; }
[Visual Basic]
Public ReadOnly Property OptionButtons() As Proofing.DialogButtonCollection

Limitations

Read only.


TXTextControl.Proofing.SpellCheckDialog.Preview Property

Gets the SpellCheckDialog's Preview instance. This property describes and handles attributes of the spell check dialog's preview component.

Syntax

[C#]
public Proofing.Preview Preview{ get; }
[Visual Basic]
Public ReadOnly Property Preview() As Proofing.Preview

Limitations

Read only.


TXTextControl.Proofing.SpellCheckDialog.IgnoreButtons Property

Gets a collection of all dialog buttons that are located to the right of the SpellCheckDialog's preview component. The property's value is an object of type DialogButtonCollection and can be modified by using its methods and properties. The default content of that collection are buttons of type 'Ignore', 'IgnoreAll' and 'AddToDictionary'.

Syntax

[C#]
public Proofing.DialogButtonCollection IgnoreButtons{ get; }
[Visual Basic]
Public ReadOnly Property IgnoreButtons() As Proofing.DialogButtonCollection

Limitations

Read only.


TXTextControl.Proofing.SpellCheckDialog.Show Method

Invokes the built-in dialog box for checking incorrect or misspelled (TXTextControl.TextControl.MisspelledWords) words. The first implementation opens the spell check dialog for checking of the TXSpellChecker.IncorrectWords collection in TXSpell for Windows Forms. To connect the SpellCheckDialog with an object of type TXTextControl.TextControl, the Show method provides the third implementation. At both implementations, the dialog's selected suggestion dictionary is specified through the SuggestionDictionaryComboBox.SuggestionDictionary property. The second and the fourth implementation can be used to invoke the dialog with another suggestion dictionary.

Show()

Invokes the built-in dialog box for correcting incorrect words of the TXSpellChecker.IncorrectWords collection in TXSpell for Windows Forms. The SuggestionDictionaryComboBox.SuggestionDictionary is selected to create suggestions.

[C#]
public void Show();
[Visual Basic]
Public Sub Show()

Show(Dictionary)

Invokes the built-in dialog box for checking incorrect words of the TXSpellChecker.IncorrectWords collection in TXSpell for Windows.Forms. The specified suggestion dictionary is selected to create suggestions.

[C#]
public void Show(Proofing.Dictionary suggestionDictionary);
[Visual Basic]
Public Sub Show(suggestionDictionary As Proofing.Dictionary)
Parameter | Description
suggestionDictionary | Specifies the dictionary used for creating suggestions. This parameter is only useful, if more than one dictionary has been added to the spellchecker's dictionary collection.

Show(Object)

Invokes the built-in dialog box for checking misspelled words (TXTextControl.TextControl.MisspelledWords) of a specific TextControl (TXTextControl.TextControl). The SuggestionDictionaryComboBox.SuggestionDictionary is selected to create suggestions.

[C#]
public void Show(object textControl);
[Visual Basic]
Public Sub Show(textControl As Object)
Parameter | Description
textControl | Specifies the object of type TXTextControl.TextControl that is connected to the dialog.

Show(Object, Dictionary)

Invokes the built-in dialog box for checking misspelled words (TXTextControl.TextControl.MisspelledWords) of a specific TextControl (TXTextControl.TextControl). The specified suggestion dictionary is selected to create suggestions.

[C#]
public void Show(object textControl, Proofing.Dictionary suggestionDictionary);
[Visual Basic]
Public Sub Show(textControl As Object, suggestionDictionary As Proofing.Dictionary)
Parameter | Description
textControl | Specifies the object of type TXTextControl.TextControl that is connected to the dialog.
suggestionDictionary | Specifies the dictionary used for creating suggestions. This parameter is only useful, if more than one dictionary has been added to the spellchecker's dictionary collection.


TXTextControl.Proofing.SpellCheckDialog.ShowMessageBoxes Property

Gets or sets a value indicating whether the dialog should invoke built-in message boxes that informs the user that the spell checking was completed or that a chosen word was not found in one of the suggestion dictionaries. The default value is true.

Syntax

[C#]
public bool ShowMessageBoxes { get; set; }
[Visual Basic]
Public Property ShowMessageBoxes() As Boolean


TXTextControl.Proofing.SpellCheckDialog.SuggestionDictionaryComboBox Property

Gets the SpellCheckDialog's SuggestionDictionaryComboBox instance. This property describes and handles attributes of the spell check dialog's suggestion dictionary combo box.

Syntax

[C#]
public Proofing.SuggestionDictionaryComboBox SuggestionDictionaryComboBox{ get; }
[Visual Basic]
Public ReadOnly Property SuggestionDictionaryComboBox() As Proofing.SuggestionDictionaryComboBox

Limitations

Read only.


TXTextControl.Proofing.SpellCheckDialog.SuggestionList Property

Gets the SpellCheckDialog's SuggestionList instance. This property describes and handles attributes of the spell check dialog's suggestion list.

Syntax

[C#]
public Proofing.SuggestionList SuggestionList{ get; }
[Visual Basic]
Public ReadOnly Property SuggestionList() As Proofing.SuggestionList

Limitations

Read only.


TXTextControl.Proofing.SpellCheckDialog.ChangeButtons Property

Gets a collection of all dialog buttons that are located to the right of the SpellCheckDialog's suggestions list. The property's value is an object of type DialogButtonCollection and can be modified by using its methods and properties. The default content of that collection are buttons of type Change and ChangeAll.

Syntax

[C#]
public Proofing.DialogButtonCollection ChangeButtons{ get; }
[Visual Basic]
Public ReadOnly Property ChangeButtons() As Proofing.DialogButtonCollection

Limitations

Read only.

<< TXTextControl.Proofing.SpellCheckDialog.SuggestionList Property


TXTextControl.Proofing.SpellCheckDialogClosingEventArgs Class

The SpellCheckDialogClosingEventArgs class provides data for the TXSpellChecker.SpellCheckDialogClosing event in TX Spell .NET for Windows Forms.

Introduced: 3.0.

Syntax

[C#]
public sealed class SpellCheckDialogOpeningEventArgs
[Visual Basic]
Public NotInheritable Class SpellCheckDialogOpeningEventArgs

Properties

Property | Description
Cancel | Gets or sets a value indicating whether the event is canceled or not.
CloseReason | Gets a value that indicates the reason of the closing.
StateManager | Gets the SpellCheckDialogStateManager which provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.


TXTextControl.Proofing.SpellCheckDialogClosingEventArgs.Cancel Property

Gets or sets a value indicating whether the event is canceled or not.

Syntax

[C#]
public bool Cancel { get; set; }
[Visual Basic]
Public Property Cancel() As Boolean

>> TXTextControl.Proofing.SpellCheckDialogClosingEventArgs.CloseReason Property


TXTextControl.Proofing.SpellCheckDialogClosingEventArgs.CloseReason Property

Gets a value that indicates the reason of the closing.

Syntax

[C#]
public System.Windows.Forms.CloseReason CloseReason{ get; }
[Visual Basic]
Public ReadOnly Property CloseReason() As System.Windows.Forms.CloseReason

Limitations

Read only.

<< TXTextControl.Proofing.SpellCheckDialogClosingEventArgs.Cancel Property | >> TXTextControl.Proofing.SpellCheckDialogClosingEventArgs.StateManager Property


TXTextControl.Proofing.SpellCheckDialogClosingEventArgs.StateManager Property

Gets the SpellCheckDialogStateManager which provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.

Syntax

[C#]
public Proofing.SpellCheckDialogStateManager StateManager { get; }
[Visual Basic]
Public ReadOnly Property StateManager() As Proofing.SpellCheckDialogStateManager

Limitations

Read only.

<< TXTextControl.Proofing.SpellCheckDialogClosingEventArgs.CloseReason Property


TXTextControl.Proofing.SpellCheckDialogOpeningEventArgs Class

The SpellCheckDialogOpeningEventArgs class provides data for the TXSpellChecker.SpellCheckDialogOpening event in TXSpell for Windows Forms.

Introduced: 3.0.

Syntax

[C#]
public sealed class SpellCheckDialogOpeningEventArgs
[Visual Basic]
Public NotInheritable Class SpellCheckDialogOpeningEventArgs

Properties

Property | Description
StateManager | Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.


TXTextControl.Proofing.SpellCheckDialogOpeningEventArgs.StateManager Property

Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.

Syntax

[C#]
public Proofing.SpellCheckDialogStateManager StateManager { get; }
[Visual Basic]
Public ReadOnly Property StateManager() As Proofing.SpellCheckDialogStateManager

Limitations

Read only.


TXTextControl.Proofing.SpellCheckDialogStateManager Class

Provides methods and properties for the StateManager property that provided by the SpellCheckDialogOpeningEventArgs, DialogButtonEventArgs and the SpellCheckDialogClosingEventArgs in TX Spell .NET for Windows.Forms.

Introduced: 3.0.

Syntax

[C#]
public sealed class SpellCheckDialogStateManager
[Visual Basic]
Public NotInheritable Class SpellCheckDialogStateManager

Properties

Property | Description
NextIFormattedText | Gets the next object of type TXTextControl.IFormattedText that contains the next misspelled word (TXTextControl.MisspelledWord).
NextIncorrectWord | Gets an object of type IncorrectWord that handled next by the SpellCheckDialog.
NextMisspelledWord | Gets an object of type TXTextControl.MisspelledWord that is handled next by the SpellCheckDialog.

Methods

Method | Description
Close | Closes the spell check dialog.
SetNext | Overloaded. Provides a method to set a specific incorrect or misspelled (TXTextControl.MisspelledWord) word, that should be handled next by the SpellCheckDialog.


TXTextControl.Proofing.SpellCheckDialogStateManager.Close Method

Closes the spell check dialog.

Syntax

[C#]
public void Close();
[Visual Basic]
Public Sub Close()

Remarks

An exception is thrown, if this method is called by the SpellCheckDialogClosingEventArgs.StateManager property.

>> TXTextControl.Proofing.SpellCheckDialogStateManager.SetNext Method


TXTextControl.Proofing.SpellCheckDialogStateManager.SetNext Method

Provides a method to set a specific incorrect or misspelled (TXTextControl.MisspelledWord) word, that should be handled next by the SpellCheckDialog. Furthermore, a complete new text or an object of type TXTextControl.TextControl can be set to the SpellCheckDialog. A new incorrect word or misspelled word (TXTextControl.IFormattedText.MisspelledWords) collection is connected and handled.

SetNext(String)

Sets the text that should be handled next by the SpellCheckDialog.

[C#]
public void SetNext(string text);
[Visual Basic]
Public Sub SetNext(text As String)
Parameter | Description
text | The text that should be handled next by the SpellCheckDialog.

SetNext(IncorrectWord)

Sets the incorrect word that should be handled next by the SpellCheckDialog.

[C#]
public void SetNext(Proofing.IncorrectWord incorrectWord);
[Visual Basic]
Public Sub SetNext(incorrectWord As Proofing.IncorrectWord)
Parameter | Description
incorrectWord | The object of type IncorrectWord that should be handled next by the SpellCheckDialog. It must be part of the incorrect word collection that was created by calling the SetNext method with a string parameter or connected by invoking the SpellCheckDialog with the first or second overload of the TXSpellChecker.SpellCheckDialog.Show method.

SetNext(Object)

Sets an object of type TXTextControl.TextControl that should be handled next by the SpellCheckDialog.

[C#]
public void SetNext(object textControl);
[Visual Basic]
Public Sub SetNext(textControl As Object)
Parameter | Description
textControl | The object of type TXTextControl.TextControl that should be handled next by the SpellCheckDialog.

SetNext(Object, Object)

Sets an object of type TXTextConrol.MisspelledWord that should be handled next by the SpellCheckDialog.

[C#]
public void SetNext(object misspelledWord, object iFormattedText);
[Visual Basic]
Public Sub SetNext(misspelledWord As Object, iFormattedText As Object)
Parameter | Description
misspelledWord | The object of type TXTextControl.MisspelledWord that should be handled next by the SpellCheckDialog.
iFormattedText | The object of type TXTextControl.IFormattedText that contains the misspelled word (TXTextControl.MisspelledWord).

Remarks

An exception is thrown for the second overload, if the SpellCheckDialog is connected to an instance of TXTextControl.WPF.TextControl.

An exception is thrown for the fourth overload, if the SpellCheckDialog is not connected to an instance of TXTextControl.TextControl object of which TextPartCollection contains the iFormattedText parameter.

<< TXTextControl.Proofing.SpellCheckDialogStateManager.Close Method | >> TXTextControl.Proofing.SpellCheckDialogStateManager.NextIncorrectWord Property


TXTextControl.Proofing.SpellCheckDialogStateManager.NextIncorrectWord Property

Gets an object of type IncorrectWord that handled next by the SpellCheckDialog.

Syntax

[C#]
public Proofing.IncorrectWord NextIncorrectWord { get; }
[Visual Basic]
Public ReadOnly Property NextIncorrectWord() As Proofing.IncorrectWord

Remarks

An exception is thrown, if the SpellCheckDialog is connected to an object of type TXTextControl.TextControl.

Limitations

Read only.

<< TXTextControl.Proofing.SpellCheckDialogStateManager.SetNext Method | >> TXTextControl.Proofing.SpellCheckDialogStateManager.NextIFormattedText Property


TXTextControl.Proofing.SpellCheckDialogStateManager.NextIFormattedText Property

Gets the next object of type TXTextControl.IFormattedText that contains the next misspelled word (TXTextControl.MisspelledWord).

Syntax

[C#]
public object NextIFormattedText { get; }
[Visual Basic]
Public ReadOnly Property NextIFormattedText() As Object

Remarks

An exception is thrown, if the SpellCheckDialog is not connected to an object of type TXTextControl.TextControl.

Limitations

Read only.

<< TXTextControl.Proofing.SpellCheckDialogStateManager.NextIncorrectWord Property | >> TXTextControl.Proofing.SpellCheckDialogStateManager.NextMisspelledWord Property


TXTextControl.Proofing.SpellCheckDialogStateManager.NextMisspelledWord Property

Gets an object of type TXTextControl.MisspelledWord that is handled next by the SpellCheckDialog.

Syntax

[C#]
public object NextMisspelledWord { get; }
[Visual Basic]
Public ReadOnly Property NextMisspelledWord() As Object

Remarks

An exception is thrown, if the SpellCheckDialog is not connected with an object of type TXTextControl.TextControl.

Limitations

Read only.

<< TXTextControl.Proofing.SpellCheckDialogStateManager.NextIFormattedText Property


TXTextControl.Proofing.SpelledWord Class

The abstract class SpelledWord represents a spelled word in a text.

Syntax

[C#]
public abstract class SpelledWord
[Visual Basic]
Public MustInherit Class SpelledWord

Properties

Property | Description
Index | Gets the index of the spelled word to the corresponding collection.
Length | Gets the length of the spelled word.
Start | Gets the starting position of a spelled word.
Text | Gets the text of the spelled word.


TXTextControl.Proofing.SpelledWord.Index Property

Gets the index of the spelled word to the corresponding collection. The first word has the index 0.

Introduced: 3.0.

Syntax

[C#]
public int Index { get; }
[Visual Basic]
Public ReadOnly Property Index() As Integer

Limitations

Read only.

>> TXTextControl.Proofing.SpelledWord.Length Property


TXTextControl.Proofing.SpelledWord.Length Property

Gets the length of the spelled word.

Syntax

[C#]
public int Length { get; }
[Visual Basic]
Public ReadOnly Property Length() As Integer

Limitations

Read only.


TXTextControl.Proofing.SpelledWord.Start Property

Gets the starting position of a spelled word. It is a zero-based index of the word's first character.

Syntax

[C#]
public int Start { get; }
[Visual Basic]
Public ReadOnly Property Start() As Integer

Limitations

Read only.


TXTextControl.Proofing.SpelledWord.Text Property

Gets the text of the spelled word.

Syntax

[C#]
public string Text { get; }
[Visual Basic]
Public ReadOnly Property Text() As String

Limitations

Read only.

<< TXTextControl.Proofing.SpelledWord.Start Property


TXTextControl.Proofing.SpellingCorrectionUIProvider Class

The SpellingCorrectionUIProvider class provides methods and properties for constructing a spelling correction user interface.

Introduced: 6.0.

Syntax

[C#]
public sealed class SpellingCorrectionUIProvider
[Visual Basic]
Public NotInheritable Class SpellingCorrectionUIProvider

Properties

Property | Description
CorrectionHandling | Gets an object of type CorrectionHandler that provides methods and properties which are necessary to construct the correction handling part of a spelling correction user interface.
PreviewHandling | Gets an object of type PreviewHandler that provides properties which are necessary to construct an editable preview for a spelling correction user interface.
StateManaging | Gets an object of type StateManager that provides methods and properties which are necessary to initialize, modify and perceive the current state of a spelling correction procedure.
SuggestionDictionariesHandling | Gets an object of type SuggestionDictionariesHandler that provides properties which are necessary to modify and perceive suggestion dictionaries in a spelling correction user interface.
SuggestionsHandling | Gets an object of type SuggestionsHandler that provides properties which are necessary to modify and perceive a list of suggestions for correcting the current word to correct in a spelling correction user interface.


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandling Property

Gets an object of type CorrectionHandler that provides methods and properties which are necessary to construct the correction handling part of a spelling correction user interface.

Syntax

[C#]
public Proofing.SpellingCorrectionUIProvider.CorrectionHandler CorrectionHandling { get; }
[Visual Basic]
Public ReadOnly Property CorrectionHandling() As Proofing.SpellingCorrectionUIProvider.CorrectionHandler

Limitations

Read only.

>> TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandling Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandling Property

Gets an object of type PreviewHandler that provides properties which are necessary to construct an editable preview for a spelling correction user interface.

Syntax

[C#]
public Proofing.SpellingCorrectionUIProvider.PreviewHandler PreviewHandling { get; }
[Visual Basic]
Public ReadOnly Property PreviewHandling() As Proofing.SpellingCorrectionUIProvider.PreviewHandler

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandling Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManaging Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManaging Property

Gets an object of type StateManager that provides methods and properties which are necessary to initialize, modify and perceive the current state of a spelling correction procedure.

Syntax

[C#]
public Proofing.SpellingCorrectionUIProvider.StateManager StateManaging { get; }
[Visual Basic]
Public ReadOnly Property StateManaging() As Proofing.SpellingCorrectionUIProvider.StateManager

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandling Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandling Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandling Property

Gets an object of type SuggestionDictionariesHandler that provides properties which are necessary to modify and perceive suggestion dictionaries in a spelling correction user interface. These dictionaries are used to create suggestions which are related to the CurrentWordToCorrect.

Syntax

[C#]
public Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler SuggestionDictionariesHandling { get; }
[Visual Basic]
Public ReadOnly Property SuggestionDictionariesHandling() As Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManaging Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandling Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandling Property

Gets an object of type SuggestionsHandler that provides properties which are necessary to modify and perceive a list of suggestions for correcting the current word to correct in a spelling correction user interface.

Syntax

[C#]
public Proofing.SpellingCorrectionUIProvider.SuggestionsHandler SuggestionsHandling { get; }
[Visual Basic]
Public ReadOnly Property SuggestionsHandling() As Proofing.SpellingCorrectionUIProvider.SuggestionsHandler

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandling Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler Class

The CorrectionHandler class provides methods and properties which are necessary to construct the correction handling part of a spelling correction user interface.

Introduced: 6.0.

Syntax

[C#]
public sealed class CorrectionHandler
[Visual Basic]
Public NotInheritable Class CorrectionHandler

Properties

Property | Description
IsAddToDictionaryEnabled | Gets a value whether the AddToDictionary method is enabled or not.
IsChangeAllEnabled | Gets a value whether the ChangeAll method is enabled or not.
IsChangeEnabled | Gets a value whether the Change method is enabled or not.
IsDeleteEnabled | Gets a value whether the Delete method is enabled or not.
IsIgnoreAllEnabled | Gets a value whether the IgnoreAll method is enabled or not.
IsIgnoreEnabled | Gets a value whether the Ignore method is enabled or not.
IsOptionsEnabled | Gets a value whether the current SpellingCorrectionUIProvider's mode is set to OptionsSettings or not.
IsUndoEditEnabled | Gets a value whether the current SpellingCorrectionUIProvider's mode is set to WordToCorrectEditing or not.

Methods

Method | Description
AddToDictionary | Adds the text of the current word to correct to all user dictionaries of the current dictionary collection where the IsEditable property is set to true and the language property corresponds to the TXTextControl.MisspelledWord.Culture or incorrect word's language property.
Change | Replaces the current word to correct with a specified word.
ChangeAll | Replaces all words to correct, that have the same text like the current uncorrected word.
CheckCorrectedWord | Returns a value whether the specified word was found in one of the current selected suggestion dictionaries or not.
Delete | Deletes the current word to correct.
Ignore | Ignores the current misspelled.
IgnoreAll | Ignores all words to correct, that have the same text like the current uncorrected word.


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.AddToDictionary Method

Adds the text of the current word to correct to all user dictionaries of the current dictionary collection where the IsEditable property is set to true and the language property corresponds to the TXTextControl.MisspelledWord.Culture or incorrect word's language property. Furthermore the word is removed from all corresponding collections (TXTextControl.MisspelledWordCollection/ IncorrectWordCollection).

Syntax

[C#]
public void AddToDictionary();
[Visual Basic]
Public Sub AddToDictionary()

Remarks

This method is only enabled if appropriated user dictionaries are available and the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated or NoSuggestionsCreated.

>> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Change Method


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Change Method

Replaces the current word to correct with a specified word.

Syntax

[C#]
public void Change(string correctedWord);
[Visual Basic]
Public Sub Change(correctedWord As String)
Parameter | Description
correctedWord | Specifies the corrected text. The text of the current word correct is replaced with this text.

Remarks

This method is only enabled if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated or WordToCorrectEditing.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.AddToDictionary Method | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.ChangeAll Method


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.ChangeAll Method

Replaces all words to correct, that have the same text like the current uncorrected word.

Syntax

[C#]
public void ChangeAll(string correctedWord);
[Visual Basic]
Public Sub ChangeAll(correctedWord As String)
Parameter | Description
correctedWord | Specifies the corrected text. The text of the current word to correct is replaced with this text.

Remarks

This method is only enabled if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated or WordToCorrectEditing.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Change Method | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.CheckCorrectedWord Method


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.CheckCorrectedWord Method

Returns a value whether the specified word was found in one of the current selected suggestion dictionaries or not.

Syntax

[C#]
public bool CheckCorrectedWord(string correctedWord, out string messageText);
[Visual Basic]
Public Sub CheckCorrectedWord(correctedWord As String, ByRef messageText As String) As Bollean
Parameter | Description
correctedWord | The specified word to check.
messageText | If the specified word was not found in one of the current selected suggestion dictionaries, the parameter is set to a message which informs the user about the result of this request. Otherwise it is set to an empty string.

Return Value

True if the specified word was found in one of the current selected suggestion dictionaries. Otherwise false.

Remarks

This method is only enabled if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated or WordToCorrectEditing.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.ChangeAll Method | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Delete Method


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Delete Method

Deletes the current word to correct.

Syntax

[C#]
public void Delete();
[Visual Basic]
Public Sub Delete()

Remarks

This method is only enabled if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated, NoSuggestionsCreated or WordToCorrectIsDuplicate.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.CheckCorrectedWord Method | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Ignore Method


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Ignore Method

Ignores the current misspelled.

Syntax

[C#]
public void Ignore();
[Visual Basic]
Public Sub Ignore()

Remarks

This method is only enabled if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated, NoSuggestionsCreated or WordToCorrectIsDuplicate.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Delete Method | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IgnoreAll Method


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IgnoreAll Method

Ignores all words to correct, that have the same text like the current uncorrected word.

Syntax

[C#]
public void IgnoreAll();
[Visual Basic]
Public Sub IgnoreAll()

Remarks

This method is only enabled if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated or NoSuggestionsCreated.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.Ignore Method | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsAddToDictionaryEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsAddToDictionaryEnabled Property

Gets a value whether the AddToDictionary method is enabled or not.

Syntax

[C#]
public bool IsAddToDictionaryEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsAddToDictionaryEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IgnoreAll Method | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeEnabled Property

Gets a value whether the Change method is enabled or not.

Syntax

[C#]
public bool IsChangeEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsChangeEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsAddToDictionaryEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeAllEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeAllEnabled Property

Gets a value whether the ChangeAll method is enabled or not.

Syntax

[C#]
public bool IsChangeAllEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsChangeAllEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsDeleteEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsDeleteEnabled Property

Gets a value whether the Delete method is enabled or not.

Syntax

[C#]
public bool IsDeleteEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsDeleteEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsChangeAllEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreEnabled Property

Gets a value whether the Ignore method is enabled or not.

Syntax

[C#]
public bool IsIgnoreEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsIgnoreEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsDeleteEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreAllEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreAllEnabled Property

Gets a value whether the IgnoreAll method is enabled or not.

Syntax

[C#]
public bool IsIgnoreAllEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsIgnoreAllEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsOptionsEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsOptionsEnabled Property

Gets a value whether the current SpellingCorrectionUIProvider's mode is set to OptionsSettings or not.

Syntax

[C#]
public bool IsOptionsEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsOptionsEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsIgnoreAllEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsUndoEditEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsUndoEditEnabled Property

Gets a value whether the current SpellingCorrectionUIProvider's mode is set to WordToCorrectEditing or not.

Syntax

[C#]
public bool IsUndoEditEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsUndoEditEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.CorrectionHandler.IsOptionsEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandler Class

The PreviewHandler class provides properties which are necessary to construct an editable preview for a spelling correction user interface.

Introduced: 6.0.

Syntax

[C#]
public sealed class PreviewHandler
[Visual Basic]
Public NotInheritable Class PreviewHandler

Properties

Property | Description
IsPreviewSentenceBoundsEnabled | Gets a value whether the PreviewSentenceBounds property is enabled to provide the sentence bounds for the current word to correct.
PreviewSentenceBounds | Gets a two values integer array that represents the start position and length of the sentence where the current word to correct is located.


TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandler.IsPreviewSentenceBoundsEnabled Property

Gets a value whether the PreviewSentenceBounds property is enabled to provide the sentence bounds for the current word to correct.

Syntax

[C#]
public bool IsPreviewSentenceBoundsEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsPreviewSentenceBoundsEnabled() As Boolean

Limitations

Read only.

>> TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandler.PreviewSentenceBounds Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandler.PreviewSentenceBounds Property

Gets a two values integer array that represents the start position and length of the sentence where the current word to correct is located. This property is redetermined on every change of the CurrentWordToCorrect property.

Syntax

[C#]
public int[] PreviewSentenceBounds { get; }
[Visual Basic]
Public ReadOnly Property PreviewSentenceBounds() As As Integer()

Remarks

This property only provides an array of sentence bounds if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated, NoSuggestionsCreated, WordToCorrectIsDuplicate or WordToCorrectEditing. Otherwise the value is null.

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.PreviewHandler.IsPreviewSentenceBoundsEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager Class

The StateManager class provides methods and properties which are necessary to initialize, modify and perceive the current state of a spelling correction procedure..

Introduced: 6.0.

Syntax

[C#]
public sealed class StateManager
[Visual Basic]
Public NotInheritable Class StateManager

Properties

Property | Description
CurrentIFormattedText | Gets that object of type TXTextControl.IFormattedText that includes the misspelled word which is currently handled by the SpellingCorrectionUIProvider.
CurrentText | Gets that text which is currently handled by the SpellingCorrectionUIProvider.
CurrentTextControl | Gets an object of type TXTextControl.TextControl and represents that TextControl which is currently handled by the SpellingCorrectionUIProvider.
CurrentWordToCorrect | Gets an object of type TXTextControl.MisspelledWord or IncorrectWord and represents that current word to correct which is currently handled by the SpellingCorrectionUIProvider.
IsOptionsSettings | Gets or sets a value whether the current state of the SpellingCorrectionUIProvider is set to OptionsSettings.
IsWordToCorrectEditing | Gets or sets a value whether the current state of the SpellingCorrectionUIProvider is set to WordToCorrectEditing.
Mode | Gets a value of type SpellingCorrectionMode that represents the current state of the SpellingCorrectionUIProvider.

Methods

Method | Description
Cancel | Resets the SpellingCorrectionUIProvider to the InitialState.
SetCurrent | Overloaded. Sets an object of type TXTextControl.TextControl or text for user interface based spelling correction.


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.Cancel Method

Resets the SpellingCorrectionUIProvider to the InitialState.

Syntax

[C#]
public void Cancel();
[Visual Basic]
Public Sub Cancel()

>> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentIFormattedText Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentIFormattedText Property

Gets that object of type TXTextControl.IFormattedText that includes the misspelled word which is currently handled by the SpellingCorrectionUIProvider. This property is updated when the CurrentWordToCorrect is redifined.

Syntax

[C#]
public object CurrentIFormattedText { get; }
[Visual Basic]
Public ReadOnly Property CurrentIFormattedText() As Object

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.Cancel Method | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentTextControl Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentTextControl Property

Gets an object of type TXTextControl.TextControl and represents that TextControl which is currently handled by the SpellingCorrectionUIProvider. This property can be set by calling the SetCurrent(object textControl) method. Furthermore, it will be set to null by calling the SetCurrent(object textControl) method with a null parameter, setting the CurrentText property or using the Cancel method.

Syntax

[C#]
public object CurrentTextControl { get; }
[Visual Basic]
Public ReadOnly Property CurrentTextControl() As Object

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentIFormattedText Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentText Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentText Property

Gets that text which is currently handled by the SpellingCorrectionUIProvider. This property can be set by calling the SetCurrent(string text) method. Furthermore, it will be set to null by calling the SetCurrent(string text) method with a null parameter, setting the CurrentTextControl property or using the Cancel method.

Syntax

[C#]
public string CurrentText { get; }
[Visual Basic]
Public ReadOnly Property CurrentText() As String

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentTextControl Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect Property

Gets an object of type TXTextControl.MisspelledWord or IncorrectWord and represents that current word to correct which is currently handled by the SpellingCorrectionUIProvider. It is redetermined on every invocation of SetCurrent, IsOptionsSetting or the TXSpell.SpellingCorrectionUIProvider.CorrectionHandler methods (AddToDictionary(), Change(string correctedWord), ChangeAll(string correctedWord), Delete(), Ignore(), IgnoreAll()). Changes on this property lead to an update of the Mode property. If the source of the word to correct is an object of type TXTextControl.TextControl, the CurrentIFormattedText property is updated as well.

Syntax

[C#]
public object CurrentWordToCorrect { get; }
[Visual Basic]
Public ReadOnly Property CurrentWordToCorrect() As Object

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentText Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing Property

Gets or sets a value whether the current state of the SpellingCorrectionUIProvider is set to WordToCorrectEditing. Setting this property is only enabled if the CurrentWordToCorrect property is not null.

Syntax

[C#]
public bool IsWordToCorrectEditing { get; set; }
[Visual Basic]
Public Property IsWordToCorrectEditing() As Boolean

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.CurrentWordToCorrect Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.IsOptionsSettings Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.IsOptionsSettings Property

Gets or sets a value whether the current state of the SpellingCorrectionUIProvider is set to OptionsSettings. If the value is true, no other method or property of the SpelleingCorrectionUIProvider except the Cancel method is enabled or enabled to be modified.

Syntax

[C#]
public bool IsOptionsSettings { get; set; }
[Visual Basic]
Public Property IsOptionsSettings() As Boolean

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.IsWordToCorrectEditing Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.Mode Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.Mode Property

Gets a value of type SpellingCorrectionMode that represents the current state of the SpellingCorrectionUIProvider.

Syntax

[C#]
public Proofing.TXSpell.SpellingCorrectionMode Mode { get; }
[Visual Basic]
Public ReadOnly Property Mode() As Proofing.TXSpell.SpellingCorrectionMode

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.IsOptionsSettings Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.SetCurrent Method


TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.SetCurrent Method

Sets an object of type TXTextControl.TextControl or text for user interface based spelling correction. Furthermore, overloads of the method determine and set a specific incorrect or misspelled (TXTextControl.MisspelledWord) word based on a specific text position to handle it by the SpellingCorrectionUIProvider.

SetCurrent(Object)

Sets an object of type TXTextControl.TextControl as CurrentTextControl to handle it by the SpellingCorrectionUIProvider. If the parameter is not null, the first TXTextControl.MisspelledWord of the TextControl is set as CurrentWordToCorrect and the corresponding TXTextControl.IFormattedText object as CurrentIFormattedText. Otherwise the SpellingCorrectionUIProvider's mode is reset to InitialState. If the TXTextControl.TextControl parameter does not contain misspelled words, the mode is set to NoWordsToCorrectFound.

[C#]
public void SetCurrent(object textControl);
[Visual Basic]
Public Sub SetCurrent(textControl As Object)
Parameter | Description
textControl | The object of type TXTextControl.TextControl that is handled by the SpellingCorrectionUIProvider.

SetCurrent(String)

Sets the text that is handled by the SpellingCorrectionUIProvider as current text. If the parameter is not null, the first incorrect word of the text is set as CurrentWordToCorrect. Otherwise the SpellingCorrectionUIProvider's mode is reset to InitialState. If the text parameter does not contain incorrect words, the mode is set to NoWordsToCorrectFound.

[C#]
public void SetCurrent(string text);
[Visual Basic]
Public Sub SetCurrent(text As String)
Parameter | Description
text | The text that is handled by the SpellingCorrectionUIProvider.

Return Value

SetCurrent methods including a textPosition parameter return true if the corresponding CurrentWordToCorrect property is changed on calling this method. Otherwise false.

Remarks

Throws an exception if the IsOptionsSettings property is set to true.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.StateManager.Mode Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler Class

The SuggestionDictionariesHandler class provides properties which are necessary to perceive and modify suggestion dictionaries in a spelling correction user interface. These dictionaries are used to create suggestions which are related to the CurrentWordToCorrect.

Introduced: 6.0.

Syntax

[C#]
public sealed class SuggestionDictionariesHandler
[Visual Basic]
Public NotInheritable Class SuggestionDictionariesHandler

Properties

Property | Description
IsSuggestionDictionariesEnabled | Gets a value whether the SuggestionDictionaries property is enabled to provide suggestion dictionaries or not.
SelectedSuggestionDictionaries | Gets or sets an array of dictionaries which are used to create suggestions for the SuggestionsHandler.Suggestions property.
SuggestionDictionaries | Gets an array of suggestion dictionaries where the dictionary's language equals to the language of the current word to correct.


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.IsSuggestionDictionariesEnabled Property

Gets a value whether the SuggestionDictionaries property is enabled to provide suggestion dictionaries or not.

Syntax

[C#]
public bool IsSuggestionDictionariesEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsSuggestionDictionariesEnabled() As Boolean

Limitations

Read only.

>> TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SelectedSuggestionDictionaries Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SelectedSuggestionDictionaries Property

Gets or sets an array of dictionaries which are used to create suggestions for the SuggestionsHandler.Suggestions property. Changes on this property lead to an update of the StateManager.Mode and SuggestionsHandler.Suggestions properties.

Syntax

[C#]
public Proofing.Dictionary[] SelectedSuggestionDictionaries { get; set;}
[Visual Basic]
Public Property SelectedSuggestionDictionaries() As Proofing.Dictionary()

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.IsSuggestionDictionariesEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SuggestionDictionaries Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SuggestionDictionaries Property

Gets an array of suggestion dictionaries where the dictionary's language equals to the language of the current word to correct. This property is redetermined on every change of the CurrentWordToCorrect property and lead to an update of the SelectedSuggestionDictionaries property.

Syntax

[C#]
public Proofing.Dictionary[] SuggestionDictionaries { get; }
[Visual Basic]
Public ReadOnly Property SuggestionDictionaries() As Proofing.Dictionary()

Remarks

This property only returns an array of suggestion dictionaries if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated, NoSuggestionsCreated, WordToCorrectIsDuplicate or WordToCorrectEditing.

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionDictionariesHandler.SelectedSuggestionDictionaries Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler Class

The SuggestionsHandler class provides properties which are necessary to modify and perceive a list of suggestions for correcting the current word to corrct in a spelling correction user interface.

Introduced: 6.0.

Syntax

[C#]
public sealed class SuggestionsHandler
[Visual Basic]
Public NotInheritable Class SuggestionsHandler

Properties

Property | Description
IsNoSuggestionsItemEnabled | Gets or sets whether a message is inside the SpellingCorrectionUIProvider's suggestion list that informs the user that no suggestions could be created for the current word to correct.
IsSuggestionListEnabled | Gets a value whether the Suggestions property is enabled to create suggestions or not.
MaxSuggestions | Gets or sets the maximum number of suggestions that has to be determined.
Suggestions | Gets an array of suggestions which are created based on the selected suggestions dictionaries.


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.IsNoSuggestionsItemEnabled Property

Gets or sets whether a message is inside the SpellingCorrectionUIProvider's suggestion list that informs the user that no suggestions could be created for the current word to correct. The default value is true.

Syntax

[C#]
public bool IsNoSuggestionsItemEnabled { get; set; }
[Visual Basic]
Public Property IsNoSuggestionsItemEnabled() As Boolean

>> TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.IsSuggestionListEnabled Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.IsSuggestionListEnabled Property

Gets a value whether the Suggestions property is enabled to create suggestions or not.

Syntax

[C#]
public bool IsSuggestionListEnabled { get; }
[Visual Basic]
Public ReadOnly Property IsSuggestionListEnabled() As Boolean

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.IsNoSuggestionsItemEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.MaxSuggestions Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.MaxSuggestions Property

Gets or sets the maximum number of suggestions that has to be determined. The default value is 10.

Syntax

[C#]
public int MaxSuggestions { get; set; }
[Visual Basic]
Public Property MaxSuggestions() As Integer

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.IsSuggestionListEnabled Property | >> TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.Suggestions Property


TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.Suggestions Property

Gets an array of suggestions which are created based on the selected suggestions dictionaries. The maximum number of items depends on the MaxSuggestion property.

Syntax

[C#]
public object[] Suggestions { get; }
[Visual Basic]
Public ReadOnly Property Suggestions() As Object()

Remarks

This property is only enabled to create suggestions if the SpellingCorrectionUIProvider's mode is set to SuggestionsCreated or WordToCorrectEditing. If is the IsNoSuggestionsItemEnabled property is true and the SpellingCorrectionUIProvider's mode is set to NoSuggestionsCreated, the property returns an array containing one item which informs the user that no suggestions could be created. In all other circumstances the method returns an empty array.

Limitations

Read only.

<< TXTextControl.Proofing.SpellingCorrectionUIProvider.SuggestionsHandler.MaxSuggestions Property


TXTextControl.Proofing.Suggestion Class

The Suggestion class represents a suggestion for a specific text.

Syntax

[C#]
public sealed class Suggestion
[Visual Basic]
Public NotInheritable Class Suggestion

Properties

Property | Description
Text | Gets the suggestion text for a specific word.


TXTextControl.Proofing.Suggestion.Text Property

Gets the suggestion text for a specific word.

Syntax

[C#]
public string Text { get; }
[Visual Basic]
Public ReadOnly Property Text() As String

Limitations

Read only.


TXTextControl.Proofing.SuggestionCollection Class

An instance of the SuggestionCollection class contains objects of the type Suggestion. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference. The SuggestionCollection is sorted by suggestions with the closest match.

Syntax

[C#]
public sealed class SuggestionCollection: CollectionBase, IEnumerable, IEnumerator
[Visual Basic]
Public NotInheritable Class SuggestionCollection
  Inherits CollectionBase
  Implements IEnumerable
  Implements IEnumerator

Methods

Method | Description
Item | Gets a suggestion from the collection.


TXTextControl.Proofing.SuggestionCollection.Item Property

Gets a suggestion from the collection. This property is the indexer for the SuggestionCollection class.

Syntax

[C#]
public Suggestion this [int number] { get; }
[Visual Basic]
Public Default ReadOnly Property Item(number As Integer) As Suggestion
Parameter | Description
number | The zero-based index of the suggested word to get.

Return Value

The object of the type Suggestion at the specified index.


TXTextControl.Proofing.SuggestionDictionaryComboBox Class

The SuggestionDictionaryComboBox class describes and handles attributes of the spell check dialog's suggestion dictionary combo box. An instance of that class is provided by the SpellCheckDialog.SuggestionDictionaryComboBox property in TX Spell .NET for Windows Forms

Introduced: 3.0.

Syntax

[C#]
public sealed class SuggestionDictionaryComboBox
[Visual Basic]
Public NotInheritable Class SuggestionDictionaryComboBox

Properties

Property | Description
IsAllItemEnabled | Gets or sets a value indicating whether the SpellCheckDialog's dictionary combo box provides an All item that represents all dictionaries that are IsGetSuggestionsEnabled to create suggestions or not.
IsAllItemSelected | Gets or sets a value indicating whether the All item of the SpellCheckDialog's dictionary combobox is selected or not.
SuggestionDictionary | Gets or sets the dictionary that is currently selected as a suggestion dictionary.


TXTextControl.Proofing.SuggestionDictionaryComboBox.IsAllItemEnabled Property

Gets or sets a value indicating whether the SpellCheckDialog's dictionary combo box provides an All item that represents all dictionaries that are IsGetSuggestionsEnabled to create suggestions or not. The All item is only provided, if the number of dictionaries, that are set to IsGetSuggestionsEnabled, is more than one. The default value is false.

Syntax

[C#]
public bool IsAllItemEnabled { get; set; }
[Visual Basic]
Public Property IsAllItemEnabled() As Boolean

>> TXTextControl.Proofing.SuggestionDictionaryComboBox.IsAllItemSelected Property


TXTextControl.Proofing.SuggestionDictionaryComboBox.IsAllItemSelected Property

Gets or sets a value indicating whether the All item of the SpellCheckDialog's dictionary combobox is selected or not. These properties can be set to true, if the SpellCheckDialog is not invoked or the SpellCheckDialog is opened, the number of dictionaries that are set to IsGetSuggestionsEnabled are more than one and the IsAllItemEnabled property is set to true. The default value is false.

Syntax

[C#]
public bool IsAllItemSelected { get; set; }
[Visual Basic]
Public Property IsAllItemSelected() As Boolean

<< TXTextControl.Proofing.SuggestionDictionaryComboBox.IsAllItemEnabled Property | >> TXTextControl.Proofing.SuggestionDictionaryComboBox.SuggestionDictionary Property


TXTextControl.Proofing.SuggestionDictionaryComboBox.SuggestionDictionary Property

Gets or sets the dictionary that is currently selected as a suggestion dictionary. If the IsAllItemSelected property is set to true, the value is null.

Syntax

[C#]
public Proofing.Dictionary SuggestionDictionary { get; set; }
[Visual Basic]
Public Property SuggestionDictionary() As Proofing.Dictionary

<< TXTextControl.Proofing.SuggestionDictionaryComboBox.IsAllItemSelected Property


TXTextControl.Proofing.SuggestionList Class

The SuggestionList class describes and handles attributes of the SpellCheckDialog's suggestion list. An instance of this class is provided by the SpellCheckDialog.SuggestionList property in TX Spell .NET for Windows Forms.

Introduced: 3.0.

Syntax

[C#]
public sealed class SuggestionList
[Visual Basic]
Public NotInheritable Class SuggestionList

Properties

Property | Description
IsNoSuggestionsItemEnabled | Gets or sets whether a message is displayed inside the SpellCheckDialog's suggestion list that informs the user that no suggestions could be created for the current incorrect word.
MaxSuggestions | Gets or sets the maximum number of suggestions that has to be determined.


TXTextControl.Proofing.SuggestionList.MaxSuggestions Property

Gets or sets the maximum number of suggestions that has to be determined. The default value is 10.

Syntax

[C#]
public int MaxSuggestions { get; set; }
[Visual Basic]
Public Property MaxSuggestions() As Integer

>> TXTextControl.Proofing.SuggestionList.IsNoSuggestionsItemEnabled Property


TXTextControl.Proofing.SuggestionList.IsNoSuggestionsItemEnabled Property

Gets or sets whether a message is displayed inside the SpellCheckDialog's suggestion list that informs the user that no suggestions could be created for the current incorrect word. The default value is true.

Syntax

[C#]
public bool IsNoSuggestionsItemEnabled { get; set; }
[Visual Basic]
Public Property IsNoSuggestionsItemEnabled() As Boolean

<< TXTextControl.Proofing.SuggestionList.MaxSuggestions Property


TXTextControl.Proofing.Synonym Class

The Synonym class represents a synonym for a specific word or phrase.

Introduced: 7.0.

Syntax

[C#]
public class Synonym
[Visual Basic]
Public Class Synonym

Properties

Property | Description
ID | Gets the lowercased identifier that represents the synonym inside the corresponding synonym list.
Name | Gets the synonym's name which is the case sensitive equivalent to the Synonym.ID property.
Text | Gets the synonym's text which is composed of the synonym's name and optional additional information.


TXTextControl.Proofing.Synonym.ID Property

Gets the lowercased identifier that represents the synonym inside the corresponding synonym list.

Syntax

[C#]
public string ID { get; }
[Visual Basic]
Public ReadOnly Property ID As String

Limitations

Read only.

>> TXTextControl.Proofing.Synonym.Name Property


TXTextControl.Proofing.Synonym.Name Property

Gets the synonym's name which is the case sensitive equivalent to the Synonym.ID property.

Syntax

[C#]
public string Name { get; }
[Visual Basic]
Public ReadOnly Property Name As String

Limitations

Read only.


TXTextControl.Proofing.Synonym.Text Property

Gets the synonym's text which is composed of the synonym's name and optional additional information.

Syntax

[C#]
public string Text { get; }
[Visual Basic]
Public ReadOnly Property Text() As String

Limitations

Read only.

<< TXTextControl.Proofing.Synonym.Name Property


TXTextControl.Proofing.SynonymGroup Class

The SynonymGroup class refers to a collection of synonyms with common meaning to the word or phrase that was determined by the TXSpell.CreateSynonyms method.

Introduced: 7.0.

Syntax

[C#]
public class SynonymGroup
[Visual Basic]
Public Class SynonymGroup

Properties

Property | Description
Language | Gets the SynonymGroup's language.
PartOfSpeech | Gets the part of speech or other meaning specific description for this SynonymGroup.
Synonyms | Gets an array of synonyms with common meaning where the first entry also describes the meaning itself.


TXTextControl.Proofing.SynonymGroup.Language Property

Gets the SynonymGroup's language. The property value equals to the language of the SynonymList that has been used to provide the SynonymGroup's synonyms.

Syntax

[C#]
public System.Globalization.CultureInfo Language { get; }
[Visual Basic]
Public ReadOnly Property Language() As System.Globalization.CultureInfo

Limitations

Read only.

>> TXTextControl.Proofing.SynonymGroup.PartOfSpeech Property


TXTextControl.Proofing.SynonymGroup.PartOfSpeech Property

Gets the part of speech or other meaning specific description for this SynonymGroup. If no such value is defined by the corresponding SynonymList, the property returns null.

Syntax

[C#]
public string PartOfSpeech { get; }
[Visual Basic]
Public ReadOnly PartOfSpeech Language() As String

Limitations

Read only.


TXTextControl.Proofing.SynonymGroup.Synonyms Property

Gets an array of synonyms with common meaning where the first entry also describes the meaning itself.

Syntax

[C#]
public Synonym[] Synonyms { get; }
[Visual Basic]
Public ReadOnly Property Synonyms() As Synonym()

Limitations

Read only.

<< TXTextControl.Proofing.SynonymGroup.PartOfSpeech Property


TXTextControl.Proofing.SynonymList Class

The SynonymList class represents a synonym list that gets its content from a thesaurus file. It can be used directly by the third overload of the TXSpell.CreateSynonyms method or by the first and second overload when the SynonymList is added to the TXSpell.SynonymLists collection. The implementation loads a synonym list from a thesaurus file that is defined by a synonym list path. When using the synonym list name without a file path, the corresponding thesaurus files of the default synonym lists folder are used.

Introduced: 7.0.

Syntax

[C#]
public class SynonymList
[Visual Basic]
Public Class SynonymList

Constructors

Constructor | Description
SynonymList | Initializes a new instance of the SynonymList class.

Properties

Property | Description
IsCreateSynonymsEnabled | Gets or sets a value that indicates whether synonyms are created using this synonym list or not.
IsSelectedAsDefault | Gets a value indicating whether the synonym list is selected as the default synonym list by the SynonymLanguage property.
Language | Gets or sets the SynonymList's language.
Name | Gets or sets the synonym list's name.


TXTextControl.Proofing.SynonymList Constructor

Initializes a new instance of the SynonymList class.

Syntax

[C#]
public SynonymList(string synonymListPath);
[Visual Basic]
Public Sub New(synonymListPath As String)
Parameter | Description
synonymListPath | Specifies the path for the thesaurus dat file. By only specifying the synonym list name without any file path, the corresponding thesaurus file of the default synonym lists folder is used. The name of the specified thesaurus file must begin with "th_" or "thes_" and end with ".dat" or ".idx". If the file does not exist, an ArgumentException is thrown.

>> TXTextControl.Proofing.SynonymList.IsCreateSynonymsEnabled Property


TXTextControl.Proofing.SynonymList.IsCreateSynonymsEnabled Property

Gets or sets a value that indicates whether synonyms are created using this synonym list or not. The default value is true.

Syntax

[C#]
public bool IsCreateSynonymsEnabled { get; set; }
[Visual Basic]
Public Property IsCreateSynonymsEnabled() As Boolean


TXTextControl.Proofing.SynonymList.IsSelectedAsDefault Property

Gets a value indicating whether the synonym list is selected as the default synonym list by the SynonymLanguage property. The default value is false.

Syntax

[C#]
public bool IsSelectedAsDefault { get; }
[Visual Basic]
Public ReadOnly Property IsSelectedAsDefault() As Boolean

Limitations

Read only.


TXTextControl.Proofing.SynonymList.Language Property

Gets or sets the SynonymList's language.

Syntax

[C#]
public System.Globalization.CultureInfo Language { get; set;}
[Visual Basic]
Public Property Language() As System.Globalization.CultureInfo

Remarks

The property is automatically set, if the name of the corresponding synonym list file contains language specific information (e.g. "th_en_US_v2.dat" for English or "th_de_DE_v2.dat" for German). Otherwise, the property returns null.


TXTextControl.Proofing.SynonymList.Name Property

Gets or sets the synonym list's name.

Syntax

[C#]
public string Name { get; set; }
[Visual Basic]
Public Property Name() As String

<< TXTextControl.Proofing.SynonymList.Language Property


TXTextControl.Proofing.SynonymListCollection Class

An instance of the SynonymListCollection class contains all objects of type SynonymList that will be used by the first and second overload of the TXSpell.CreateSynonyms method. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces, please see the .NET Framework reference.

Introduced: 7.0.

Syntax

[C#]
public sealed class SynonymListCollection: CollectionBase, IEnumerable, IEnumerator
[Visual Basic]
Public NotInheritable Class SynonymListCollection
  Inherits CollectionBase
  Implements IEnumerable
  Implements IEnumerator

Methods

Method | Description
Add | Adds objects of type SynonymList to the collection.
GetItem | Gets a particular SynonymList from the collection by using the specified name.
Item | Gets an object of type SynonymList from the collection.
Remove | Removes objects of type SynonymList from the collection.


TXTextControl.Proofing.SynonymListCollection.Add Method

Adds objects of type SynonymList to the collection.

Syntax

[C#]
public int Add(Proofing.SynonymList synonymList);
[Visual Basic]
Public Function Add(synonymList As Proofing.SynonymList) As Integer
Parameter | Description
synonymList | Specifies the SynonymList.

Return Value

The collection index where the SynonymList has been added.

>> TXTextControl.Proofing.SynonymListCollection.GetItem Method


TXTextControl.Proofing.SynonymListCollection.GetItem Method

Gets a particular SynonymList from the collection by using the specified name.

Syntax

[C#]
public Proofing.SynonymList GetItem(string name);
[Visual Basic]
Public Function GetItem(name As String) As Proofing.SynonymList
Parameter | Description
name | Specifies a synonym list name.

Return Value

The return value is null, if a SynonymList with the specified name could not be found. Otherwise, it is an object of type SynonymList.


TXTextControl.Proofing.SynonymListCollection.Item Property

Gets an object of type SynonymList from the collection. This property is the indexer for the SynonymListCollection class.

Syntax

[C#]
public Proofing.SynonymList this [int number] { get; }
[Visual Basic]
Public Default ReadOnly Property Item(number As Integer) As Proofing.SynonymList
Parameter | Description
number | The zero-based index of the SynonymList.

Return Value

The object of type SynonymList at the specified index.


TXTextControl.Proofing.SynonymListCollection.Remove Method

Removes objects of type SynonymList from the collection.

Syntax

[C#]
public void Remove(Proofing.SynonymList synonymList);
[Visual Basic]
Public Sub Remove(synonymList As Proofing.SynonymList)
Parameter | Description
synonymList | Specifies the SynonymList.

<< TXTextControl.Proofing.SynonymListCollection.Item Property


TXTextControl.Proofing.TXSpell Class

The TXSpell class provides properties and methods with spell checking features. It is particularly suitable for spell checking tasks, where no text components are required. This could be spell checking text or getting suggestions for an incorrect word. Spell checking tasks with text components can be handled by using the TXSpellChecker class, if the text component provides an interface to connect it with the TXSpellChecker component. The following describes the properties, methods and events defined through the TXSpell class.

Syntax

[C#]
public sealed class TXSpell
[Visual Basic]
Public NotInheritable Class TXSpell

Constructors

Constructor | Description
TXSpell | Overloaded. Initializes a new instance of the TXSpell class.

Properties

Property | Description
AvailableDictionaries | Gets a list of all available dictionaries of the default dictionary folder.
AvailableHyphenationLists | Gets a list of all available hyphenation lists of the default hyphenation lists folder.
AvailableSynonymLists | Gets a list of all available synonym lists of the default synonym lists folder.
DetectableLanguageScopes | Gets or sets a list of all languages that are used to detect language scopes in a text.
Dictionaries | Gets a collection of all added and validated dictionaries.
DictionariesDirectoryPath | Gets or sets the path to the default dictionaries folder.
HyphenationLanguage | Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true.
HyphenationLists | Gets a collection of all added hyphenation dictionaries.
HyphenationListsDirectoryPath | Gets or sets the path to the default hyphenation lists folder.
IgnoreCase | Gets or sets a value of type IgnoreCaseSettings determining whether the case of a word is ignored or not during spell checking.
IgnoreWord | Gets or sets a value of type IgnoreWordSettings determining when a word should not be spell checked.
IncorrectWords | Gets a collection of all incorrect words that were detected by the last call of the TXSpell.Check method.
Language | Gets or sets the name of a dictionary that is located at the default dictionary folder. When using the Language property, the Dictionary.IsSelectedAsDefault property of the chosen dictionary is set to true.
LanguageRecognitionDirectoryPath | Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text.
LanguageScopes | Gets a collection of all detected language scopes.
SpellingCorrectionUIProvider | Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.
Suggestions | Gets a collection of suggestions that were created by the last call of the TXSpell.CreateSuggestions method.
SynonymLanguage | Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true.
SynonymLists | Gets a collection of all added synonym lists.
SynonymListsDirectoryPath | Gets or sets the path to the default synonym lists folder.

Methods

Method | Description
Check | Overloaded. Checks text for spelling errors and fills the IncorrectWordCollection at TXSpell.IncorrectWords with all incorrect words.
Create | Initializes the resources of a newly instantiated TXSpell object.
CreateSuggestions | Overloaded. Determines suggestions for a specific incorrect word by using selected dictionaries of the DictionaryCollection at TXSpell.Dictionaries and fills the results into the SuggestionCollection at TXSpell.Suggestions. If no maximum number of suggestions is set, all created suggestions are added into TXSpell.Suggestions.
CreateSynonyms | Overloaded. Returns groups of synonyms that represent equivalent expressions for a specific text.
DetectLanguageScopes | Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpell.LanguageScopes.
GetHyphenationPoint | Overloaded. Returns the next hyphenation point for a specific word right before a defined divide position.
GetHyphenationPoints | Overloaded. Returns an array of all hyphenation points for a word.


TXTextControl.Proofing.TXSpell Constructor

Initializes a new instance of the TXSpell class.

TXSpell()

Initializes a new instance of the TXSpell class. For spell check operations that dictionary will be used which was defined by the TXSpell.Language property.

[C#]
public TXSpell();
[Visual Basic]
Public Sub New()

TXSpell(String)

Initializes a new instance of the TXSpell class. For spell check operations, a dictionary is used that corresponds to the specified language.

[C#]
public TXSpell(string language);
[Visual Basic]
Public Sub New(language As String)
Parameter | Description
language | The name of a dictionary that is located in the default dictionary folder and should be loaded as the default dictionary. The parameter corresponds to the TXSpell.Language property.

>> TXTextControl.Proofing.TXSpell.AvailableDictionaries Property


TXTextControl.Proofing.TXSpell.AvailableDictionaries Property

Gets a list of all available dictionaries of the default dictionary folder.

Introduced: 3.0.

Syntax

[C#]
public string[] AvailableDictionaries{ get; }
[Visual Basic]
Public ReadOnly Property AvailableDictionaries() As String()

Limitations

Read only.


TXTextControl.Proofing.TXSpell.AvailableHyphenationLists Property

Gets a list of all available hyphenation lists of the default hyphenation lists folder.

Introduced: 4.0.

Syntax

[C#]
public string[] AvailableHyphenationLists{ get; }
[Visual Basic]
Public ReadOnly Property AvailableHyphenationLists() As String()

Limitations

Read only.


TXTextControl.Proofing.TXSpell.AvailableSynonymLists Property

Gets a list of all available synonym lists of the default synonym lists folder.

Introduced: 7.0.

Syntax

[C#]
public string[] AvailableSynonymLists{ get; }
[Visual Basic]
Public ReadOnly Property AvailableSynonymLists() As String()

Limitations

Read only.


TXTextControl.Proofing.TXSpell.Check Method

Checks text for spelling errors and fills the IncorrectWordCollection at TXSpell.IncorrectWords with all incorrect words. The first implementation uses selected dictionaries of the DictionaryCollection at TXSpell.Dictionaries. The second implementation uses selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used whose Dictionary.IsSpellCheckingEnabled properties are set to true.

Check(String)

Checks text for spelling errors using selected dictionaries of the DictionaryCollection at TXSpell.Dictionaries.

[C#]
public void Check(string text);
[Visual Basic]
Public Sub Check(text As String)
Parameter | Description
text | Specifies the text to spell check.

Check(String, CultureInfo)

Checks text for spelling errors using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void Check(string text, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub Check(text As String, language As System.Globalization.CultureInfo)
Parameter | Description
text | Specifies the text to spell check.
language | The language that is used to spell check the specified text.

Remarks

This method throws an exception, if called while the SpellCheckDialog is open.


TXTextControl.Proofing.TXSpell.Create Method

Initializes the resources of a newly instantiated TXSpell object. This method must be called before using the object.

Syntax

[C#]
public void Create();
[Visual Basic]
Public Sub Create()


TXTextControl.Proofing.TXSpell.CreateSuggestions Method

Determines suggestions for a specific incorrect word by using selected dictionaries of the DictionaryCollection at TXSpell.Dictionaries and fills the results into the SuggestionCollection at TXSpell.Suggestions. If no maximum number of suggestions is set, all created suggestions are added into TXSpell.Suggestions. Otherwise, only the first maximum number of suggestions are determined. The second and fourth implementation uses selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used where the Dictionary.IsGetSuggestionsEnabled property is set to true.

CreateSuggestions(String)

Determines suggestions for a specific incorrect word.

[C#]
public void CreateSuggestions(string incorrectWord);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.

CreateSuggestions(String, CultureInfo)

Determines suggestions for a specific incorrect word using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void CreateSuggestions(string incorrectWord, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, language As System.Globalization.CultureInfo)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
language | The language that is used to create suggestions for the specified incorrect word.

CreateSuggestions(String, Int32)

Determines a maximum number of suggestions for a specific incorrect word.

[C#]
public void CreateSuggestions(string incorrectWord, int max);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, max As Integer)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
max | Specifies the maximum number of suggestions that has to be determined.

CreateSuggestions(String, Int32, CultureInfo)

Determines a maximum number of suggestions for a specific incorrect word using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void CreateSuggestions(string incorrectWord, int max, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, max As Integer, language As System.Globalization.CultureInfo)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
max | Specifies the maximum number of suggestions that has to be determined.
language | The language that is used to create suggestions for the specified incorrect word.


TXTextControl.Proofing.TXSpell.CreateSynonyms Method

Returns groups of synonyms that represent equivalent expressions for a specific text. The first implementation uses selected synonym lists of the SynonymListCollection at TXSpell.SynonymLists. The second implementation uses selected synonym lists of the TXSpell.SynonymLists collection and the default synonym lists folder where the synonym list's language equals to the defined language parameter. The last overload creates synonym groups for a specific synonym list. Only those synonym lists are used whose SynonymList.IsCreateSynonymsEnabled properties are set to true.

Introduced: 7.0.

CreateSynonyms(String)

Returns synonyms for a specific text using the selected synonym lists of the SynonymListCollection at the TXSpell.SynonymLists.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text);
[Visual Basic]
Public Function CreateSynonyms(text As String) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.

CreateSynonyms(String, CultureInfo)

Returns synonyms for a specific text using the selected synonym lists of the SynonymListCollection at the TXSpell.SynonymLists and the default synonym lists folder where the synonym list's language equals to the defined language parameter.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function CreateSynonyms(text As String, language As System.Globalization.CultureInfo) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.
language | The language that is used to create synonyms for the specified text.

CreateSynonyms(String, SynonymList)

Returns synonyms for a specific text using a specific SynonymList.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text, Proofing.SynonymList synonymList);
[Visual Basic]
Public Function CreateSynonyms(text As String, synonymList As Proofing.SynonymList) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.
synonymList | The synonymList that is used to create synonyms for the specified text.


TXTextControl.Proofing.TXSpell.DetectableLanguageScopes Property

Gets or sets a list of all languages that are used to detect language scopes in a text.

Introduced: 5.0.

Syntax

[C#]
public CultureInfo[] DetectableLanguageScopes{ get; set; }
[Visual Basic]
Public Property DetectableLanguageScopes() As CultureInfo()

Remarks

From the 10 most occurring native languages TX Spell supports Arabic, German, English, Spanish, French, Portuguese and Russian. These languages are set as default for detecting language scopes.


TXTextControl.Proofing.TXSpell.DetectLanguageScopes Method

Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpell.LanguageScopes.

Introduced: 5.0.

Syntax

[C#]
public void DetectLanguageScopes(string text);
[Visual Basic]
Public Sub DetectLanguageScopes(text As String)
Parameter | Description
text | Specifies the text where to detect language scopes.

Remarks

The languages that are used to detect language scopes in a text can be defined by the TXSpell.DetectableLanguageScopes property.


TXTextControl.Proofing.TXSpell.Dictionaries Property

Gets a collection of all added and validated dictionaries. The property's value is an object of type DictionaryCollection.

Syntax

[C#]
public Proofing.DictionaryCollection Dictionaries{ get; }
[Visual Basic]
Public ReadOnly Property Dictionaries() As Proofing.DictionaryCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpell.DictionariesDirectoryPath Property

Gets or sets the path to the default dictionaries folder. The default value is "(Auto)" that determines the Dictionaries directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string DictionariesDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property DictionariesDirectoryPath() As String


TXTextControl.Proofing.TXSpell.HyphenationListsDirectoryPath Property

Gets or sets the path to the default hyphenation lists folder. The default value is "(Auto)" that determines the HyphenationLists directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string HyphenationListsDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property HyphenationListsDirectoryPath() As String


TXTextControl.Proofing.TXSpell.GetHyphenationPoint Method

Returns the next hyphenation point for a specific word right before a defined divide position. Using the first implementation that point is caluclated by applying the default hyphenation list. The second implementation uses a hyphenation list of the TXSpell.HyphenationLists collection or a list from the default hyphenation lists folder that corresponds to the specified language parameter (second implementation). If there is no hyphenation point before that divide position and the position is less the word length, the method returns 0. For divide positions greater than or equal to the number of word characters, the method returns the word length.

Introduced: 4.0.

GetHyphenationPoint(String, Int32)

Returns the next hyphenation point for a specific word right before a defined divide position. That point is calculated by using the default hyphenation list.

[C#]
public int GetHyphenationPoint(string word, int dividePosition);
[Visual Basic]
Public Function GetHyphenationPoint(ByVal word As String, ByVal dividePosition As Integer) As Integer
Parameter | Description
word | The word to hyphenate.
dividePosition | The defined divide position.

GetHyphenationPoint(String, Int32, CultureInfo)

Returns the next hyphenation point for a specific word right before a defined divide position. That point is calculated by using the hyphenation list that corresponds to the specified language parameter

[C#]
public int GetHyphenationPoint(string word, int dividePosition, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function GetHyphenationPoint(ByVal word As String, ByVal dividePosition As Integer, language As System.Globalization.CultureInfo) As Integer
Parameter | Description
word | The word to hyphenate.
dividePosition | The defined divide position.
language | The language, which is used to calculate the hyphenation point. If the TXSpell.HyphenationLists collection does not contain a hyphenation list, where its language does not equal exactly to the defined language parameter, the default hyphenation lists folder is examined for such a list. In case no corresponding list was found, both, first the TXSpell.HyphenationLists collection and finally the default hyphenation lists folder, are examined for a hyphenation list that equals roughly to specified language (e.g. the language parameter stands for English (USA) and the hyphenation list's language property represents English (Great Britain)).

Return Value

The next hyphenation point right before the defined divide position.


TXTextControl.Proofing.TXSpell.GetHyphenationPoints Method

Returns an array of all hyphenation points for a word. Using the first implementation these points are caluclated by applying the default hyphenation list. The second implementation uses a hyphenation list of the TXSpell.HyphenationLists collection or a list from the default hyphenation lists folder that corresponds to the specified language parameter (second implementation).

Introduced: 4.0.

GetHyphenationPoints(String)

Returns an array of all hyphenation points for a word. These points are calculated by using the default hyphenation list.

[C#]
public int[] GetHyphenationPoints(string word);
[Visual Basic]
Public Function GetHyphenationPoints(ByVal word As String) As Integer()
Parameter | Description
word | The word to hyphenate.

GetHyphenationPoints(String, CultureInfo)

Returns an array of all hyphenation points for a word. These points are calculated by using the hyphenation list that corresponds to the specified language parameter

[C#]
public int[] GetHyphenationPoints(string word, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function GetHyphenationPoints(ByVal word As String, language As System.Globalization.CultureInfo) As Integer()
Parameter | Description
word | The word to hyphenate.
language | The language, which is used to calculate the hyphenation points. If the TXSpell.HyphenationLists collection does not contain a hyphenation list, where its language does not equal exactly to the defined language parameter, the default hyphenation lists folder is examined for such a list. In case no corresponding list was found, both, first the TXSpell.HyphenationLists collection and finally the default hyphenation lists folder, are examined for a hyphenation list that equals roughly to specified language (e.g. the language parameter stands for English (USA) and the hyphenation list's language property represents English (Great Britain)).

Return Value

An array of all hyphenation points for the defined word.


TXTextControl.Proofing.TXSpell.HyphenationLanguage Property

Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true. The default value is "(Auto)".

Introduced: 4.0.

Syntax

[C#]
public string HyphenationLanguage{ get; set; }
[Visual Basic]
Public Property HyphenationLanguage() As String
Value | Description
"hyph__.dic" | The corresponding hyphenation list is added to the TXSpell.HyphenationLists collection (e.g. "hyph_en_US.dic" for the US English hyphenation list).
"(Auto)" | That hyphenation list is added to the TXSpell.HyphenationLists collection that equals to the language of the default spell check dictionary. If the default hyphenation lists folder does not contain such a hyphenation list, a list is chosen that corresponds roughly to the dictionary's language (e.g. the default dictionary is "en_GB", but the default hyphenation lists folder only contains a "hyph_en_US.dic" and a "hyph_de_DE.dic" hyphenation list. In this case, the "hyph_en_US.dic" hyphenation list is chosen.). In case that no default spell check dictionary is selected (TXSpell.Language is set to "(none)"), a hyphenation list is chosen that equals or roughly equals to the language of the application environment.
"(none)" | No hyphenation list is set.

Remarks

The property is reset to "(none)", if there is no corresponding hyphenation list in the default hyphenation lists folder that corresponds to the language of the default dictionary's language or the language of the application environment.


TXTextControl.Proofing.TXSpell.HyphenationLists Property

Gets a collection of all added hyphenation dictionaries. The property's value is an object of type HyphenationListCollection.

Introduced: 4.0.

Syntax

[C#]
public Proofing.HyphenationListCollection HyphenationLists{ get; }
[Visual Basic]
Public ReadOnly Property HyphenationLists() As Proofing.HyphenationListCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpell.IgnoreCase Property

Gets or sets a value of type IgnoreCaseSettings determining whether the case of a word is ignored or not during spell checking. The default value is AllUpper | WordBeginUpper.

Syntax

[C#]
public Proofing.TXSpell.IgnoreCaseSettings IgnoreCase { get; set; }
[Visual Basic]
Public Property IgnoreCase() As Proofing.TXSpell.IgnoreCaseSettings

Remarks

The IgnoreCaseSettings enumeration values Always, Never, WordBegin and WordBeginUpper must not be combined among one another, but can be combined with AllLower and/or AllUpper.

For all other combinations an exception is thrown.


TXTextControl.Proofing.TXSpell.IgnoreWord Property

Gets or sets a value of type IgnoreWordSettings determining when a word should not be spell checked. The default value is InUpperCase | IsEmail | IsURL | WithNumbers.

Syntax

[C#]
public Proofing.TXSpell.IgnoreWordSettings IgnoreWord { get; set; }
[Visual Basic]
Public Property IgnoreWord() As Proofing.TXSpell.IgnoreWordSettings

Remarks

All values of the IgnoreWordSettings enumeration (apart from IgnoreWordSettings.Never) can be combined. For combinations with IgnoreWordSettings.Never an exception is thrown.


TXTextControl.Proofing.TXSpell.IncorrectWords Property

Gets a collection of all incorrect words that were detected by the last call of the TXSpell.Check method. The property's value is an object of the type IncorrectWordCollection.

Syntax

[C#]
public Proofing.IncorrectWordCollection IncorrectWords{ get; }
[Visual Basic]
Public ReadOnly Property IncorrectWords() As Proofing.IncorrectWordCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpell.Language Property

Gets or sets the name of a dictionary that is located at the default dictionary folder. When using the Language property, the Dictionary.IsSelectedAsDefault property of the chosen dictionary is set to true. The default value is "(Auto)".

Syntax

[C#]
public string Language{ get; set; }
[Visual Basic]
Public Property Language() As String
Value | Description
"__.dic" | The corresponding OpenOfficeDictionary is added to the TXSpell.Dictionaries collection (e.g. "en_US.dic" for the US english dictionary).
"__.txd" | The corresponding UserDictionary is added to the TXSpell.Dictionaries collection (e.g. "MyUserDictionary.txd" for an user dictionary that is located inside the default dictionary folder).
"(Auto)" | That Dictionary is added to the TXSpell.Dictionaries collection that equals to the language of the application environment. If the default dictionary folder does not contain such a dictionary, a dictionary is chosen that corresponds roughly to the environment language (e.g. the application environment is "en_GB", but the default dictionary folder only contains an "en_US" and a "de_DE" dictionary. In this case, the "en_US" dictionary is chosen.). In all other cases (e.g. a German environment, but no German dictionary available), the "en_US" dictionary or (if no "en_US" dictionary available) the first dictionary inside the default dictionary folder is loaded. The TXSpell.Language Property is set to "(none)", if the default dictionary folder does not contain any dictionaries.
"(none)" | No dictionary is set.

Remarks

The property is reset to "(Auto)", if there is no corresponding dictionary in the default dictionary folder and to "(none)", if the directory contains no dictionary.


TXTextControl.Proofing.TXSpell.LanguageRecognitionDirectoryPath Property

Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text. The default value is "(Auto)" that determines the LanguageRecognition directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string LanguageRecognitionDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property LanguageRecognitionDirectoryPath() As String


TXTextControl.Proofing.TXSpell.LanguageScopes Property

Gets a collection of all detected language scopes. The property's value is an object of type LanguageScopeCollection.

Introduced: 5.0.

Syntax

[C#]
public Proofing.LanguageScopeCollection LanguageScopes{ get; }
[Visual Basic]
Public ReadOnly Property LanguageScopes() As Proofing.LanguageScopeCollection

Limitations

Read only.

<< TXTextControl.Proofing.TXSpell.LanguageRecognitionDirectoryPath Property | >> TXTextControl.Proofing.TXSpell.SpellingCorrectionUIProvider Property


TXTextControl.Proofing.TXSpell.SpellingCorrectionUIProvider Property

Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.

Introduced: 6.0.

Syntax

[C#]
public Proofing.SpellingCorrectionUIProvider SpellingCorrectionUIProvider{ get; }
[Visual Basic]
Public ReadOnly Property SpellingCorrectionUIProvider() As Proofing.SpellingCorrectionUIProvider

Limitations

Read only.


TXTextControl.Proofing.TXSpell.Suggestions Property

Gets a collection of suggestions that were created by the last call of the TXSpell.CreateSuggestions method. The property's value is an object of type SuggestionCollection.

Syntax

[C#]
public Proofing.SuggestionCollection Suggestions{ get; }
[Visual Basic]
Public ReadOnly Property Suggestions() As Proofing.SuggestionCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpell.SynonymLanguage Property

Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true. The default value is "(Auto)".

Introduced: 7.0.

Syntax

[C#]
public string SynonymLanguage{ get; set; }
[Visual Basic]
Public Property SynonymLanguage() As String
Value | Description
"__.dat" or "__.idx" | The corresponding synonym list is added to the TXSpell.SynonymLists collection (e.g. "th_en_US_v2.dat" for the US English synonym list).
"(Auto)" | That synonym list is added to the TXSpell.SynonymLists collection that equals to the language of the default spell check dictionary. If the default synonym lists folder does not contain such a synonym list, a list is selected that corresponds roughly to the dictionary's language (e.g. the default dictionary is "de_CH", but the default synonym lists folder only contains a "th_en_US_v2.dat" and a "th_de_DE_v2.dat" synonym list. In this case, the "th_de_DE_v2.dat" synonym list is selected.). In case no default spell check dictionary is selected (TXSpell.Language is set to "(none)") or no synonym list was found that resembles the default dictionary's language, a synonym list is selected that equals or roughly equals to the language of the application environment. If no such synonym list is given, the "en_US" synonym list or (if no "en_US" synonym list available) the first synonym list of the default synonym lists folder is selected. The TXSpell.SynonymLanguage Property is set to "(none)", if the default synonym list folder does not contain any synonym lists.
"(none)" | No synonym list is set.

Remarks

The property is reset to "(Auto)", if there is no corresponding synonym list in the default synonym lists folder and to "(none)", if the directory contains no synonym list.


TXTextControl.Proofing.TXSpell.SynonymLists Property

Gets a collection of all added synonym lists. The property's value is an object of type SynonymListCollection.

Introduced: 7.0.

Syntax

[C#]
public Proofing.SynonymListCollection SynonymLists{ get; }
[Visual Basic]
Public ReadOnly Property SynonymLists() As Proofing.SynonymListCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpell.SynonymListsDirectoryPath Property

Gets or sets the path to the default synonym lists folder. The default value is "(Auto)" that determines the SynonymLists directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string SynonymListsDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property SynonymListsDirectoryPath() As String

<< TXTextControl.Proofing.TXSpell.SynonymLists Property


TXTextControl.Proofing.TXSpellChecker Class

The TXSpellChecker class implements a component with spell checking features. It allows to set general spell checking settings by using an options dialog, to invoke a customizable SpellCheckDialog that can be connected to different types of controls (e.g. TXTextControl.TextControl and System.Windows.Forms.RichtTextBox) and to create a spell checking context menu by using the TXSpellChecker.GetMenuItems method. Currently, TXTextControl (version 17.0 and better) provides the TextControl.SpellChecker Property to connect the TXSpellChecker with its TextControl component. To invoke the internal or an own spell check context menu on right clicking a misspelled word, the TextControl.SpellCheckContextMenuStrip Property must be set. The TXSpellChecker class is inherited from the System.ComponentModel.Component class. The following describes only the properties, methods and events defined through the TXSpellChecker class. For a list of properties, methods and events inherited from the System.ComponentModel.Component class see the .NET Framework reference.

Syntax

[C#]
public sealed class TXSpellChecker : System.ComponentModel.Component
[Visual Basic]
Public NotInheritable Class TXSpellChecker
  Inherits System.ComponentModel.Component

Constructors

Constructor | Description
TXSpellChecker | Overloaded. Initializes a new instance of the TXSpellChecker class.

Properties

Property | Description
AvailableDictionaries | Gets a list of all available dictionaries in the default dictionary folder.
AvailableHyphenationLists | Gets a list of all available hyphenation lists of the default hyphenation lists folder.
AvailableSynonymLists | Gets a list of all available synonym lists of the default synonym lists folder.
DetectableLanguageScopes | Gets or sets a list of all languages that are used to detect language scopes in a text.
Dictionaries | Gets a collection of all added and validated dictionaries.
DictionariesDirectoryPath | Gets or sets the path to the default dictionaries folder.
HyphenationLanguage | Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true.
HyphenationLists | Gets a collection of all added hyphenation dictionaries.
HyphenationListsDirectoryPath | Gets or sets the path to the default hyphenation lists folder.
IgnoreCase | Gets or sets a value of type IgnoreCaseSettings determining if and how the case of a word is ignored while spell checking.
IgnoreWord | Gets or sets a value of type IgnoreWordSettings determining when a word should not be spell checked.
IncorrectWords | Gets a collection of all incorrect words that were detected by the last call of the TXSpellChecker.Check method.
Language | Gets or sets the name of a dictionary that is located at the default dictionary folder. Using the Language property, the Dictionary.IsSelectedAsDefault property of the chosen dictionary is set to true.
LanguageRecognitionDirectoryPath | Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text.
LanguageScopes | Gets a collection of all detected language scopes.
SpellCheckDialog | Gets an object of type SpellCheckDialog that is used to modify and show the built-in SpellCheckDialog.
SpellingCorrectionUIProvider | Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.
Suggestions | Gets a collection of suggestions that were created by the last call of the TXSpellChecker.CreateSuggestions method.
SynonymLanguage | Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true.
SynonymLists | Gets a collection of all added synonym lists.
SynonymListsDirectoryPath | Gets or sets the path to the default synonym lists folder.

Methods

Method | Description
Check | Overloaded. Checks text for spelling errors and fills the IncorrectWordCollection at TXSpellChecker.IncorrectWords with all incorrect words.
Create | Initializes the resources of a newly instantiated TXSpellChecker object.
CreateSuggestions | Overloaded. Determines suggestions for a specific incorrect word by using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries and fills the results into the SuggestionCollection at TXSpellChecker.Suggestions. If no maximum number of suggestions is set, all created suggestions are added to TXSpellChecker.Suggestions.
CreateSynonyms | Overloaded. Returns groups of synonyms that represent equivalent expressions for a specific text.
DetectLanguageScopes | Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpellChecker.LanguageScopes.
GetHyphenationPoint | Overloaded. Returns the next hyphenation point for a specific word right before a defined divide position.
GetHyphenationPoints | Overloaded. Returns an array of all hyphenation points for a word.
GetMenuItems | Overloaded. Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.
OptionsDialog | Overloaded. Invokes the built-in dialog box to define spell check, create suggestions, hyphenation and create synonyms settings.

Events

Event | Description
DialogButtonClicked | Occurs when a dialog button of the built-in SpellCheckDialog was clicked.
DictionaryAdded | Occurs when a dictionary was added to the TXSpellChecker.Dictionaries DictionaryCollection.
DictionaryRemoved | Occurs when a dictionary was removed from the TXSpellChecker.Dictionaries DictionaryCollection.
IncorrectWordChanging | Occurs when an object of type IncorrectWord is changing by spell check context menu or spell check dialog operations.
MenuItemClicked | Occurs when a MenuItem is clicked.
MisspelledWordChanging | Occurs when an object of type TXTextControl.MisspelledWord is changing by spell check context menu or spell check dialog operations.
OptionsDialogOpening | Occurs when a the built-in options dialog is invoked by the TXSpellChecker.OptionsDialog method or clicking the Options... button of the built-in SpellCheckDialog.
SpellCheckDialogClosing | Occurs when the built-in spell check dialog is closing.
SpellCheckDialogOpening | Occurs when the built-in spell check dialog is invoked using the SpellCheckDialog.Show method.
UserDictionaryWordAdded | Occurs when a word is added to a user dictionary.
UserDictionaryWordRemoved | Occurs when a word is removed from a user dictionary.


TXTextControl.Proofing.TXSpellChecker Constructor

Initializes a new instance of the TXSpellChecker class.

TXSpellChecker()

Initializes a new instance of the TXSpellChecker class. For spell check operations, a dictionary is used that is defined through the TXSpellChecker.Language property.

[C#]
public TXSpellChecker();
[Visual Basic]
Public Sub New()

TXSpellChecker(String)

Initializes a new instance of the TXSpellChecker class. For spell check operations, a dictionary is used that corresponds to the specified language.

[C#]
public TXSpellChecker(string language);
[Visual Basic]
Public Sub New(language As String)
Parameter | Description
language | The name of a dictionary that is located in the default dictionary folder and is loaded as default dictionary. The parameter corresponds to the TXSpellChecker.Language property.

>> TXTextControl.Proofing.TXSpellChecker.AvailableDictionaries Property


TXTextControl.Proofing.TXSpellChecker.AvailableDictionaries Property

Gets a list of all available dictionaries in the default dictionary folder.

Introduced: 3.0.

Syntax

[C#]
public string[] AvailableDictionaries{ get; }
[Visual Basic]
Public ReadOnly Property AvailableDictionaries() As String()

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.AvailableHyphenationLists Property

Gets a list of all available hyphenation lists of the default hyphenation lists folder.

Introduced: 4.0.

Syntax

[C#]
public string[] AvailableHyphenationLists{ get; }
[Visual Basic]
Public ReadOnly Property AvailableHyphenationLists() As String()

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.AvailableSynonymLists Property

Gets a list of all available synonym lists of the default synonym lists folder.

Introduced: 7.0.

Syntax

[C#]
public string[] AvailableSynonymLists{ get; }
[Visual Basic]
Public ReadOnly Property AvailableSynonymLists() As String()

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.Check Method

Checks text for spelling errors and fills the IncorrectWordCollection at TXSpellChecker.IncorrectWords with all incorrect words. The first implementation uses selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries. The second implementation uses selected dictionaries of the TXSpellChecker.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used whose Dictionary.IsSpellCheckingEnabled properties are set to true.

Check(String)

Checks text for spelling errors using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries.

[C#]
public void Check(string text);
[Visual Basic]
Public Sub Check(text As String)
Parameter | Description
text | Specifies the text to spell check.

Check(String, CultureInfo)

Checks text for spelling errors using selected dictionaries of the TXSpellChecker.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void Check(string text, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub Check(text As String, language As System.Globalization.CultureInfo)
Parameter | Description
text | Specifies the text to spell check.
language | The language that is used to spell check the specified text.

Remarks

This method throws an exception, if called while the SpellCheckDialog is open.


TXTextControl.Proofing.TXSpellChecker.Create Method

Initializes the resources of a newly instantiated TXSpellChecker object. This method must be called before using the object. If TX Spell .NET is connected to a TXTextControl.TextControl instance, this method is called implicitely and must not be called separately.

Syntax

[C#]
public void Create();
[Visual Basic]
Public Sub Create()


TXTextControl.Proofing.TXSpellChecker.CreateSuggestions Method

Determines suggestions for a specific incorrect word by using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries and fills the results into the SuggestionCollection at TXSpellChecker.Suggestions. If no maximum number of suggestions is set, all created suggestions are added to TXSpellChecker.Suggestions. Otherwise, only the first maximum number of suggestions are determined. The second and fourth implementation uses selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used where the Dictionary.IsGetSuggestionsEnabled property is set to true.

CreateSuggestions(String)

Determines suggestions for a specific incorrect word.

[C#]
public void CreateSuggestions(string incorrectWord);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.

CreateSuggestions(String, CultureInfo)

Determines suggestions for a specific incorrect word using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void CreateSuggestions(string incorrectWord, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, language As System.Globalization.CultureInfo)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
language | The language that is used to create suggestions for the specified incorrect word.

CreateSuggestions(String, Int32)

Determines a maximum number of suggestions for a specific incorrect word.

[C#]
public void CreateSuggestions(string incorrectWord, int max);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, max As Integer)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
max | Specifies the maximum number of suggestions that has to be determined.

CreateSuggestions(String, Int32, CultureInfo)

Determines a maximum number of suggestions for a specific incorrect word using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void CreateSuggestions(string incorrectWord, int max, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, max As Integer, language As System.Globalization.CultureInfo)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
max | Specifies the maximum number of suggestions that has to be determined.
language | The language that is used to create suggestions for the specified incorrect word.


TXTextControl.Proofing.TXSpellChecker.CreateSynonyms Method

Returns groups of synonyms that represent equivalent expressions for a specific text. The first implementation uses selected synonym lists of the SynonymListCollection at TXSpellChecker.SynonymLists. The second implementation uses selected synonym lists of the TXSpellChecker.SynonymLists collection and the default synonym lists folder where the synonym list's language equals to the defined language parameter. The last overload creates synonym groups for a specific synonym list. Only those synonym lists are used whose SynonymList.IsCreateSynonymsEnabled properties are set to true.

Introduced: 7.0.

CreateSynonyms(String)

Returns synonyms for a specific text using the selected synonym lists of the SynonymListCollection at the TXSpellChecker.SynonymLists.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text);
[Visual Basic]
Public Function CreateSynonyms(text As String) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.

CreateSynonyms(String, CultureInfo)

Returns synonyms for a specific text using the selected synonym lists of the SynonymListCollection at the TXSpellChecker.SynonymLists and the default synonym lists folder where the synonym list's language equals to the defined language parameter.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function CreateSynonyms(text As String, language As System.Globalization.CultureInfo) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.
language | The language that is used to create synonyms for the specified text.

CreateSynonyms(String, SynonymList)

Returns synonyms for a specific text using a specific SynonymList.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text, Proofing.SynonymList synonymList);
[Visual Basic]
Public Function CreateSynonyms(text As String, synonymList As Proofing.SynonymList) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.
synonymList | The synonymList that is used to create synonyms for the specified text.


TXTextControl.Proofing.TXSpellChecker.DetectableLanguageScopes Property

Gets or sets a list of all languages that are used to detect language scopes in a text.

Introduced: 5.0.

Syntax

[C#]
public CultureInfo[] DetectableLanguageScopes{ get; set; }
[Visual Basic]
Public Property DetectableLanguageScopes() As CultureInfo()

Remarks

From the 10 most occurring native languages TX Spell supports Arabic, German, English, Spanish, French, Portuguese and Russian. These languages are set as default for detecting language scopes.


TXTextControl.Proofing.TXSpellChecker.DetectLanguageScopes Method

Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpellChecker.LanguageScopes.

Introduced: 5.0.

Syntax

[C#]
public void DetectLanguageScopes(string text);
[Visual Basic]
Public Sub DetectLanguageScopes(text As String)
Parameter | Description
text | Specifies the text where to detect language scopes.

Remarks

The languages that are used to detect language scopes in a text can be defined by the TXSpellChecker.DetectableLanguageScopes property.


TXTextControl.Proofing.TXSpellChecker.DialogButtonClicked Event

Occurs when a dialog button of the built-in SpellCheckDialog was clicked. The DialogButtonHandler receives an argument of type DialogButtonEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.DialogButtonHandler DialogButtonClicked;
[Visual Basic]
Public Event DialogButtonClicked As Proofing.DialogButtonHandler


TXTextControl.Proofing.TXSpellChecker.Dictionaries Property

Gets a collection of all added and validated dictionaries. The property's value is an object of type DictionaryCollection.

Syntax

[C#]
public Proofing.DictionaryCollection Dictionaries{ get; }
[Visual Basic]
Public ReadOnly Property Dictionaries() As Proofing.DictionaryCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.DictionaryAdded Event

Occurs when a dictionary was added to the TXSpellChecker.Dictionaries DictionaryCollection. The DictionaryAddedHandler receives an argument of type DictionaryAddedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.DictionaryAddedHandler DictionaryAdded;
[Visual Basic]
Public Event DictionaryAdded As Proofing.DictionaryAddedHandler


TXTextControl.Proofing.TXSpellChecker.DictionaryRemoved Event

Occurs when a dictionary was removed from the TXSpellChecker.Dictionaries DictionaryCollection. The DictionaryRemovedHandler receives an argument of type DictionaryRemovedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.DictionaryRemovedHandler DictionaryRemoved;
[Visual Basic]
Public Event DictionaryRemoved As Proofing.DictionaryRemovedHandler


TXTextControl.Proofing.TXSpellChecker.DictionariesDirectoryPath Property

Gets or sets the path to the default dictionaries folder. The default value is "(Auto)" that determines the Dictionaries directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string DictionariesDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property DictionariesDirectoryPath() As String


TXTextControl.Proofing.TXSpellChecker.HyphenationListsDirectoryPath Property

Gets or sets the path to the default hyphenation lists folder. The default value is "(Auto)" that determines the HyphenationLists directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string HyphenationListsDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property HyphenationListsDirectoryPath() As String


TXTextControl.Proofing.TXSpellChecker.GetHyphenationPoint Method

Returns the next hyphenation point for a specific word right before a defined divide position. Using the first implementation that point is caluclated by applying the default hyphenation list. The second implementation uses a hyphenation list of the TXSpellChecker.HyphenationLists collection or a list from the default hyphenation lists folder that corresponds to the specified language parameter (second implementation). If there is no hyphenation point before that divide position and the position is less the word length, the method returns 0. For divide positions greater than or equal to the number of word characters, the method returns the word length.

Introduced: 4.0.

GetHyphenationPoint(String, Int32)

Returns the next hyphenation point for a specific word right before a defined divide position. That point is calculated by using the default hyphenation list.

[C#]
public int GetHyphenationPoint(string word, int dividePosition);
[Visual Basic]
Public Function GetHyphenationPoint(ByVal word As String, ByVal dividePosition As Integer) As Integer
Parameter | Description
word | The word to hyphenate.
dividePosition | The defined divide position.

GetHyphenationPoint(String, Int32, CultureInfo)

Returns the next hyphenation point for a specific word right before a defined divide position. That point is calculated by using the hyphenation list that corresponds to the specified language parameter

[C#]
public int GetHyphenationPoint(string word, int dividePosition, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function GetHyphenationPoint(ByVal word As String, ByVal dividePosition As Integer, language As System.Globalization.CultureInfo) As Integer
Parameter | Description
word | The word to hyphenate.
dividePosition | The defined divide position.
language | The language, which is used to calculate the hyphenation point. If the TXSpellChecker.HyphenationLists collection does not contain a hyphenation list, where its language does not equal exactly to the defined language parameter, the default hyphenation lists folder is examined for such a list. In case no corresponding list was found, both, first the TXSpellChecker.HyphenationLists collection and finally the default hyphenation lists folder, are examined for a hyphenation list that equals roughly to specified language (e.g. the language parameter stands for English (USA) and the hyphenation list's language property represents English (Great Britain)).

Return Value

The next hyphenation point right before the defined divide position.

<< TXTextControl.Proofing.TXSpellChecker.HyphenationListsDirectoryPath Property | >> TXTextControl.Proofing.TXSpellChecker.GetHyphenationPoints Method


TXTextControl.Proofing.TXSpellChecker.GetHyphenationPoints Method

Returns an array of all hyphenation points for a word. Using the first implementation these points are caluclated by applying the default hyphenation list. The second implementation uses a hyphenation list of the TXSpellChecker.HyphenationLists collection or a list from the default hyphenation lists folder that corresponds to the specified language parameter (second implementation).

Introduced: 4.0.

GetHyphenationPoints(String)

Returns an array of all hyphenation points for a word. These points are calculated by using the default hyphenation list.

[C#]
public int[] GetHyphenationPoints(string word);
[Visual Basic]
Public Function GetHyphenationPoints(ByVal word As String) As Integer()
Parameter | Description
word | The word to hyphenate.

GetHyphenationPoints(String, CultureInfo)

Returns an array of all hyphenation points for a word. These points are calculated by using the hyphenation list that corresponds to the specified language parameter

[C#]
public int[] GetHyphenationPoints(string word, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function GetHyphenationPoints(ByVal word As String, language As System.Globalization.CultureInfo) As Integer()
Parameter | Description
word | The word to hyphenate.
language | The language, which is used to calculate the hyphenation points. If the TXSpellChecker.HyphenationLists collection does not contain a hyphenation list, where its language does not equal exactly to the defined language parameter, the default hyphenation lists folder is examined for such a list. In case no corresponding list was found, both, first the TXSpellChecker.HyphenationLists collection and finally the default hyphenation lists folder, are examined for a hyphenation list that equals roughly to specified language (e.g. the language parameter stands for English (USA) and the hyphenation list's language property represents English (Great Britain)).

Return Value

An array of all hyphenation points for the defined word.


TXTextControl.Proofing.TXSpellChecker.GetMenuItems Method

Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.

Introduced: 3.0.

GetMenuItems(Object, Object, Int32)

Returns an array of MenuItems for a specific object of type TXTextControl.MisspelledWord.

[C#]
public Proofing.MenuItem[] GetMenuItems(object misspelledWord, object textControl, int maxSuggestions);
[Visual Basic]
Public Function GetMenuItems(misspelledWord As Object, textControl As Object, maxSuggestions As Integer) As Proofing.MenuItem()
Parameter | Description
misspelledWord | The misspelled word of type TXTextControl.MisspelledWord for that the array of menu items are created.
textControl | The control of type TXTextControl.TextControl that contains the misspelled word.
maxSuggestions | The maximum number of suggestions that should be created for the incorrect word.

GetMenuItems(IncorrectWord, String, Int32)

Returns an array of MenuItems for a specific IncorrectWord.

[C#]
public Proofing.MenuItem[] GetMenuItems(Proofing.IncorrectWord incorrectWord, string sourceText, int maxSuggestions);
[Visual Basic]
Public Function GetMenuItems(incorrectWord As Proofing.IncorrectWord, sourceText As String, maxSuggestions As Integer) As Proofing.MenuItem()
Parameter | Description
incorrectWord | The misspelled word of type IncorrectWord for that the array of menu items is created.
sourceText | The text that contains the misspelled word.
maxSuggestions | The maximum number of suggestions that should be created for the incorrect word.

Return Value

The array of type MenuItem for the specified misspelled word.


TXTextControl.Proofing.TXSpellChecker.HyphenationLanguage Property

Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true. The default value is "(Auto)".

Introduced: 4.0.

Syntax

[C#]
public string HyphenationLanguage{ get; set; }
[Visual Basic]
Public Property HyphenationLanguage() As String
Value | Description
"hyph__.dic" | The corresponding hyphenation list is added to the TXSpell.HyphenationLists collection (e.g. "hyph_en_US.dic" for the US English hyphenation list).
"(Auto)" | That hyphenation list is added to the TXSpell.HyphenationLists collection that equals to the language of the default spell check dictionary. If the default hyphenation lists folder does not contain such a hyphenation list, a list is chosen that corresponds roughly to the dictionary's language (e.g. the default dictionary is "en_GB", but the default hyphenation lists folder only contains a "hyph_en_US.dic" and a "hyph_de_DE.dic" hyphenation list. In this case, the "hyph_en_US.dic" hyphenation list is chosen.). In case that no default spell check dictionary is selected (TXSpell.Language is set to "(none)"), a hyphenation list is chosen that equals or roughly equals to the language of the application environment.
"(none)" | No hyphenation list is set.

Remarks

The property is reset to "(none)", if there is no corresponding hyphenation list in the default hyphenation lists folder that corresponds to the language of the default dictionary's language or the language of the application environment.


TXTextControl.Proofing.TXSpellChecker.HyphenationLists Property

Gets a collection of all added hyphenation dictionaries. The property's value is an object of type HyphenationListCollection.

Introduced: 4.0.

Syntax

[C#]
public Proofing.HyphenationListCollection HyphenationLists{ get; }
[Visual Basic]
Public ReadOnly Property HyphenationLists() As Proofing.HyphenationListCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.IgnoreCase Property

Gets or sets a value of type IgnoreCaseSettings determining if and how the case of a word is ignored while spell checking. The default value is AllUpper | WordBeginUpper.

Syntax

[C#]
public Proofing.TXSpell.IgnoreCaseSettings IgnoreCase { get; set; }
[Visual Basic]
Public Property IgnoreCase() As Proofing.TXSpell.IgnoreCaseSettings

Remarks

The IgnoreCaseSettings enumeration values Always, Never, WordBegin and WordBeginUpper must not be combined among one another, but can be combined with AllLower and/or AllUpper.

For all other combinations an exception is thrown.


TXTextControl.Proofing.TXSpellChecker.IgnoreWord Property

Gets or sets a value of type IgnoreWordSettings determining when a word should not be spell checked. The default value is InUpperCase | IsEmail | IsURL | WithNumbers.

Syntax

[C#]
public Proofing.TXSpell.IgnoreWordSettings IgnoreWord { get; set; }
[Visual Basic]
Public Property IgnoreWord() As Proofing.TXSpell.IgnoreWordSettings

Remarks

All values of the IgnoreWordSettings enumeration (apart from IgnoreWordSettings.Never) can be combined. For combinations with IgnoreWordSettings.Never an exception is thrown.


TXTextControl.Proofing.TXSpellChecker.IncorrectWordChanging Event

Occurs when an object of type IncorrectWord is changing by spell check context menu or spell check dialog operations. The IncorrectWordChangingHandler receives an argument of type IncorrectWordChangingEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.IncorrectWordChangingHandler IncorrectWordChanging;
[Visual Basic]
Public Event IncorrectWordChanging As Proofing.IncorrectWordChangingHandler

Remarks

This event does not occur on changing objects of type TXTextControl.MisspelledWord. Those operations are handled by the MisspelledWordChanging event.


TXTextControl.Proofing.TXSpellChecker.IncorrectWords Property

Gets a collection of all incorrect words that were detected by the last call of the TXSpellChecker.Check method. The property's value is an object of type IncorrectWordCollection.

Syntax

[C#]
public Proofing.IncorrectWordCollection IncorrectWords{ get; }
[Visual Basic]
Public ReadOnly Property IncorrectWords() As Proofing.IncorrectWordCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.Language Property

Gets or sets the name of a dictionary that is located at the default dictionary folder. Using the Language property, the Dictionary.IsSelectedAsDefault property of the chosen dictionary is set to true. The default value is "(Auto)".

Syntax

[C#]
public string Language{ get; set; }
[Visual Basic]
Public Property Language() As String
Value | Description
"__.dic" | The corresponding OpenOfficeDictionary is added to the TXSpellChecker.Dictionaries collection (e.g. "en_US.dic" for the US english dictionary).
"__.txd" | The corresponding UserDictionary is added to the TXSpellChecker.Dictionaries collection (e.g. "MyUserDictionary.txd" for an user dictionary that is located in the default dictionary folder).
"(Auto)" | That Dictionary is added to the TXSpellChecker.Dictionaries collection that equals the language of the application environment. If the default dictionary folder does not contain such a dictionary, a dictionary is chosen that corresponds roughly to the environment language (e.g. the application environment is "en_GB", but the default dictionary folder only contains an "en_US" and a "de_DE" dictionary. In this case, the "en_US" dictionary is chosen.). In all other cases (e.g. a German environment, but no German dictionary available) the "en_US" dictionary or (if no "en_US" dictionary available) the first dictionary in the default dictionary folder is loaded. The TXSpellChecker.Language Property is set to "(none)", if the default dictionary folder does not contain any dictionaries.
"(none)" | No dictionary is set.

Remarks

The property is reset to "(Auto)", if there is no corresponding dictionary in the default dictionary folder and to "(none)", if the directory contains no dictionary.

<< TXTextControl.Proofing.TXSpellChecker.IncorrectWords Property | >> TXTextControl.Proofing.TXSpellChecker.LanguageRecognitionDirectoryPath Property


TXTextControl.Proofing.TXSpellChecker.LanguageRecognitionDirectoryPath Property

Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text. The default value is "(Auto)" that determines the LanguageRecognition directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string LanguageRecognitionDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property LanguageRecognitionDirectoryPath() As String


TXTextControl.Proofing.TXSpellChecker.LanguageScopes Property

Gets a collection of all detected language scopes. The property's value is an object of type LanguageScopeCollection.

Introduced: 5.0.

Syntax

[C#]
public Proofing.LanguageScopeCollection LanguageScopes{ get; }
[Visual Basic]
Public ReadOnly Property LanguageScopes() As Proofing.LanguageScopeCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.MenuItemClicked Event

Occurs when a MenuItem is clicked. The MenuItemClickedHandler receives an argument of type MenuItemClickedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.MenuItemClickedHandler MenuItemClicked;
[Visual Basic]
Public Event MenuItemClicked As Proofing.MenuItemClickedHandler


TXTextControl.Proofing.TXSpellChecker.MisspelledWordChanging Event

Occurs when an object of type TXTextControl.MisspelledWord is changing by spell check context menu or spell check dialog operations. The MisspelledWordChangingHandler receives an argument of type MisspelledWordChangingEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.MisspelledWordChangingHandler MisspelledWordChanging;
[Visual Basic]
Public Event MisspelledWordChanging As Proofing.MisspelledWordChangingHandler

Remarks

This event does not occur either on changing objects of type IncorrectWord or changing TXTextControl.MisspelledWord objects by using the TXTextControl.TextControl's built-in spell check context menu or spell check dialog. Changing operations on incorrect words are handled by the IncorrectWordChanging event.


TXTextControl.Proofing.TXSpellChecker.OptionsDialogOpening Event

Occurs when a the built-in options dialog is invoked by the TXSpellChecker.OptionsDialog method or clicking the Options... button of the built-in SpellCheckDialog. The OptionsDialogOpeningHandler receives an argument of type OptionsDialogOpeningEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.OptionsDialogOpeningHandler OptionsDialogOpening;
[Visual Basic]
Public Event OptionsDialogOpening As Proofing.OptionsDialogOpeningHandler


TXTextControl.Proofing.TXSpellChecker.OptionsDialog Method

Invokes the built-in dialog box to define spell check, create suggestions, hyphenation and create synonyms settings.

OptionsDialog()

Invokes the built-in dialog box that shows all tabs.

[C#]
public void OptionsDialog();
[Visual Basic]
Public Sub OptionsDialog()

OptionsDialog(Int32[])

Invokes the built-in dialog box that shows those tabs that are related to the specified indices.

[C#]
public void OptionsDialog(int[] activeTabs);
[Visual Basic]
Public Sub OptionsDialog(activeTabs As Integer())
Parameter | Description
activeTabs | Specifies the indices of the tabs, zero-based, which are displayed when the tabbed dialog box is opened. Index 0 stands for the spell checking options tab such as case sensitivity and ignoring words. The tab represented by index 1 displays all loaded dictionaries. Tab 2 provides hyphenation options. Tab 3 shows an overview of all loaded Thesaurus files.

OptionsDialog(ShowDialogSettings)

Invokes the built-in dialog box with a ShowDialogSettings instance that shows all tabs.

[C#]
public void OptionsDialog(Proofing.ShowDialogSettings showDialogSettings);
[Visual Basic]
Public Sub OptionsDialog(showDialogSettings as Proofing.ShowDialogSettings)
Parameter | Description
showDialogSettings | Sets an instance of the ShowDialogSettings class to determine the dialog's start position and owner.

OptionsDialog(ShowDialogSettings, Int32[])

Invokes the built-in dialog box with a ShowDialogSettings instance that shows those tabs that are related to the specified indices.

[C#]
public void OptionsDialog(Proofing.ShowDialogSettings showDialogSettings, int[] activeTabs);
[Visual Basic]
Public Sub OptionsDialog(showDialogSettings as Proofing.ShowDialogSettings, activeTabs As Integer())
Parameter | Description
showDialogSettings | Sets an instance of the ShowDialogSettings class to determine the dialog's start position and owner.
activeTabs | Specifies the indices of the tabs, zero-based, which are displayed when the tabbed dialog box is opened. Index 0 stands for the spell checking options tab such as case sensitivity and ignoring words. The tab represented by index 1 displays all loaded dictionaries. Tab 2 provides hyphenation options. Tab 3 shows an overview of all loaded Thesaurus files.

Remarks

The number of active tabs for the options dialog must be at least one. Otherwise, an ArgumentException is thrown.


TXTextControl.Proofing.TXSpellChecker.SpellCheckDialog Property

Gets an object of type SpellCheckDialog that is used to modify and show the built-in SpellCheckDialog.

Introduced: 3.0.

Syntax

[C#]
public Proofing.SpellCheckDialog SpellCheckDialog{ get; }
[Visual Basic]
Public ReadOnly Property SpellCheckDialog() As Proofing.SpellCheckDialog

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.SpellCheckDialogClosing Event

Occurs when the built-in spell check dialog is closing. The SpellCheckDialogClosingHandler receives an argument of type SpellCheckDialogClosingEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.SpellCheckDialogClosingHandler SpellCheckDialogClosing;
[Visual Basic]
Public Event SpellCheckDialogClosing As Proofing.SpellCheckDialogClosingHandler


TXTextControl.Proofing.TXSpellChecker.SpellCheckDialogOpening Event

Occurs when the built-in spell check dialog is invoked using the SpellCheckDialog.Show method. The SpellCheckDialogOpeningHandler receives an argument of type SpellCheckDialogOpeningEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.SpellCheckDialogOpeningHandler SpellCheckDialogOpening;
[Visual Basic]
Public Event SpellCheckDialogOpening As Proofing.SpellCheckDialogOpeningHandler

<< TXTextControl.Proofing.TXSpellChecker.SpellCheckDialogClosing Event | >> TXTextControl.Proofing.TXSpellChecker.SpellingCorrectionUIProvider Property


TXTextControl.Proofing.TXSpellChecker.SpellingCorrectionUIProvider Property

Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.

Introduced: 6.0.

Syntax

[C#]
public Proofing.SpellingCorrectionUIProvider SpellingCorrectionUIProvider{ get; }
[Visual Basic]
Public ReadOnly Property SpellingCorrectionUIProvider() As Proofing.SpellingCorrectionUIProvider

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.Suggestions Property

Gets a collection of suggestions that were created by the last call of the TXSpellChecker.CreateSuggestions method. The property's value is an object of type SuggestionCollection.

Syntax

[C#]
public Proofing.SuggestionCollection Suggestions{ get; }
[Visual Basic]
Public ReadOnly Property Suggestions() As Proofing.SuggestionCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.SynonymLists Property

Gets a collection of all added synonym lists. The property's value is an object of type SynonymListCollection.

Introduced: 7.0.

Syntax

[C#]
public Proofing.SynonymListCollection SynonymLists{ get; }
[Visual Basic]
Public ReadOnly Property SynonymLists() As Proofing.SynonymListCollection

Limitations

Read only.


TXTextControl.Proofing.TXSpellChecker.SynonymListsDirectoryPath Property

Gets or sets the path to the default synonym lists folder. The default value is "(Auto)" that determines the SynonymLists directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string SynonymListsDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property SynonymListsDirectoryPath() As String


TXTextControl.Proofing.TXSpellChecker.SynonymLanguage Property

Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true. The default value is "(Auto)".

Introduced: 7.0.

Syntax

[C#]
public string SynonymLanguage{ get; set; }
[Visual Basic]
Public Property SynonymLanguage() As String
Value | Description
"__.dat" or "__.idx" | The corresponding synonym list is added to the TXSpellChecker.SynonymLists collection (e.g. "th_en_US_v2.dat" for the US English synonym list).
"(Auto)" | That synonym list is added to the TXSpellChecker.SynonymLists collection that equals to the language of the default spell check dictionary. If the default synonym lists folder does not contain such a synonym list, a list is selected that corresponds roughly to the dictionary's language (e.g. the default dictionary is "de_CH", but the default synonym lists folder only contains a "th_en_US_v2.dat" and a "th_de_DE_v2.dat" synonym list. In this case, the "th_de_DE_v2.dat" synonym list is selected.). In case no default spell check dictionary is selected (TXSpellChecker.Language is set to "(none)") or no synonym list was found that resembles the default dictionary's language, a synonym list is selected that equals or roughly equals to the language of the application environment. If no such synonym list is given, the "en_US" synonym list or (if no "en_US" synonym list available) the first synonym list of the default synonym lists folder is selected. The TXSpellChecker.SynonymLanguage Property is set to "(none)", if the default synonym list folder does not contain any synonym lists.
"(none)" | No synonym list is set.

Remarks

The property is reset to "(Auto)", if there is no corresponding synonym list in the default synonym lists folder and to "(none)", if the directory contains no synonym list.


TXTextControl.Proofing.TXSpellChecker.UserDictionaryWordAdded Event

Occurs when a word is added to a user dictionary. The UserDictionaryWordAddedHandler receives an argument of type UserDictionaryWordAddedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.UserDictionaryWordAddedHandler UserDictionaryWordAdded;
[Visual Basic]
Public Event UserDictionaryWordAdded As Proofing.UserDictionaryWordAddedHandler


TXTextControl.Proofing.TXSpellChecker.UserDictionaryWordRemoved Event

Occurs when a word is removed from a user dictionary. The UserDictionaryWordRemovedHandler receives an argument of type UserDictionaryWordRemovedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.UserDictionaryWordRemovedHandler UserDictionaryWordRemoved;
[Visual Basic]
Public Event UserDictionaryWordRemoved As Proofing.UserDictionaryWordRemovedHandler

<< TXTextControl.Proofing.TXSpellChecker.UserDictionaryWordAdded Event


TXTextControl.Proofing.UserDictionary Class

The UserDictionary class represents a dictionary that allows to use, create and edit user dictionaries. The first constructor creates an empty UserDictionary object with no reference to a file. The second constructor initializes a new UserDictionary object that is filled with the content of a specified word list file. As with all dictionaries of type Dictionary, the content of the dictionary is only accessed when the dictionary was added to the TXSpell.Dictionaries collection. The third constructor loads a dictionary from string arrays that represent the content of an user dictionary. It is recommended to create that array by using the encoding that was used to create the source of that dictionary. Using that implementation, it is required to define the language of the dictionary through the System.Globalization.CultureInfo language parameter that sets the user dictionary's Language property automatically. To declare a specific encoding for the dictionary, use the Dictionary.DictionaryEncoding property. If the encoding is not declared through the property or inside the word list file, the encoding of operation system's current ANSI code page is used. The UserDictionary class is inherited from the abstract class Dictionary.

Syntax

[C#]
public class UserDictionary : Dictionary
[Visual Basic]
Public Class UserDictionary
  Inherits Dictionary

Constructors

Constructor | Description
UserDictionary | Overloaded. Initializes a new instance of the UserDictionary class.

Properties

Property | Description
DictionaryEncoding | Gets or sets the dictionary's encoding. (Inherited from Proofing.Dictionary.)
FilePath | Gets the name and path of the file that has been used to load this user dictionary or where it has been saved to.
IsEditable | Gets or sets a value indicating whether the user dictionary is editable or not.
IsGetSuggestionsEnabled | Gets or sets a value that indicates whether suggestions are created using this dictionary or not. (Inherited from Proofing.Dictionary.)
IsSelectedAsDefault | Gets a value indicating whether the dictionary is selected as the default dictionary by the Language property. (Inherited from Proofing.Dictionary.)
IsSpellCheckingEnabled | Gets or sets a value indicating whether spell checking of this dictionary is enabled or not. (Inherited from Proofing.Dictionary.)
Language | Gets or sets the dictionary's language. (Inherited from Proofing.Dictionary.)
Name | Gets or sets the dictionary's name. (Inherited from Proofing.Dictionary.)
ShowInOptionsDialog | Gets or sets a value indicating whether the dictionary is shown in the options dialog. (Inherited from Proofing.Dictionary.)

Methods

Method | Description
AddWord | Adds a word to the user dictionary.
RemoveAllWords | Removes all words from the user dictionary.
RemoveWord | Removes a word the user dictionary.
Save | Overloaded. Saves the complete content of the user dictionary in a file at the specified path or as a string array.
ToArray | Converts all user dictionary entries to a string array.


TXTextControl.Proofing.UserDictionary Constructor

Initializes a new instance of the UserDictionary class.

UserDictionary()

Creates an empty instance of the UserDictionary class.

[C#]
public UserDictionary();
[Visual Basic]
Public Sub New()

UserDictionary(String)

Initializes a new instance of the UserDictionary class by loading a specific user dictionary file.

[C#]
public UserDictionary(string userDictionaryPath);
[Visual Basic]
Public Sub New(userDictionaryPath As String)
Parameter | Description
userDictionaryPath | Specifies the path of the user dictionary file. Using the dictionary name without any file path, the corresponding dictionary file in the default dictionary folder is used. The name of the specified user dictionary file must end with ".txd". If the file does not exist, or if it is not valid, an ArgumentException is thrown.

UserDictionary(String[], CultureInfo)

Initializes a new instance of the UserDictionary class by loading a string array that represents the content of a user dictionary file.

[C#]
public UserDictionary(string[] dictionaryLines, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub New(dictionaryLines As String(), language As System.Globalization.CultureInfo)
Parameter | Description
dictionaryLines | The string array that represents the content of a user dictionary file. Each string of the array IS considered as a line of the dictionary file.
language | Specifies the language of the dictionary.

>> TXTextControl.Proofing.UserDictionary.AddWord Method


TXTextControl.Proofing.UserDictionary.AddWord Method

Adds a word to the user dictionary. The method has no effect, if the UserDictionary.IsEditable property is false or the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection.

Syntax

[C#]
public bool AddWord(string word);
[Visual Basic]
Public Function AddWord(word As String) As Boolean
Parameter | Description
word | Specifies the word to add to the user dictionary.

Return Value

The return value is true, if the word could be added. Otherwise, it is false.


TXTextControl.Proofing.UserDictionary.IsEditable Property

Gets or sets a value indicating whether the user dictionary is editable or not. The default value is true.

Syntax

[C#]
public bool IsEditable{ get; set; }
[Visual Basic]
Public Property IsEditable() As Boolean


TXTextControl.Proofing.UserDictionary.FilePath Property

Gets the name and path of the file that has been used to load this user dictionary or where it has been saved to. If the user dictionary was neither loaded from nor saved as a file, the property returns null.

Introduced: 7.0.

Syntax

[C#]
public string FilePath{ get;}
[Visual Basic]
Public ReadOnly Property FilePath() As String

Limitations

Read only.


TXTextControl.Proofing.UserDictionary.RemoveAllWords Method

Removes all words from the user dictionary. The method has no effect, if the UserDictionary.IsEditable property is false or the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection.

Syntax

[C#]
public bool RemoveAllWords();
[Visual Basic]
Public Function RemoveAllWords() As Boolean

Return Value

The return value is true, if all words could be removed. Otherwise, it is false.


TXTextControl.Proofing.UserDictionary.RemoveWord Method

Removes a word the user dictionary. The method has no effect if the UserDictionary.IsEditable property is false or the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection.

Syntax

[C#]
public bool RemoveWord(string word);
[Visual Basic]
Public Function RemoveWord(word As String) As Boolean
Parameter | Description
word | Specifies the word to remove from the user dictionary.

Return Value

The return value is true, if the word could be removed. Otherwise, it is false.


TXTextControl.Proofing.UserDictionary.Save Method

Saves the complete content of the user dictionary in a file at the specified path or as a string array. If using a file name without any file path, the user dictionary is saved in the default dictionary folder. The method has no effect, if the specified path does not end with ".txd" or the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection.

Save(String)

Saves the complete content of the user dictionary in a file.

[C#]
public bool Save(string userDictionaryPath);
[Visual Basic]
Public Function Save(userDictionaryPath As String) As Boolean
Parameter | Description
userDictionaryPath | Specifies a file that is used to save the user dictionary. If the file does not exist, it is created. Otherwise its contents are overwritten. If the path is not valid, an ArgumentException is thrown.

Save(String[])

Saves the complete content of the user dictionary as a string array.

[C#]
public void Save(out string[] stringArray);
[Visual Basic]
Public Sub Save(ByRef stringArray As String())
Parameter | Description
stringArray | Specifies a string array that is used to save the user dictionary.

Return Value

The method returns true, if the user dictionary could be saved or false if not.


TXTextControl.Proofing.UserDictionary.ToArray Method

Converts all user dictionary entries to a string array.

Syntax

[C#]
public string[] ToArray();
[Visual Basic]
Public Function ToArray() As String()

Return Value

The return value is a string array of all user dictionary entries. If the user dictionary is not added to the TXSpell.Dictionaries or TXSpellChecker.Dictionaries DictionaryCollection, the method returns an empty string array.

<< TXTextControl.Proofing.UserDictionary.Save Method


TXTextControl.Proofing.UserDictionaryWordAddedEventArgs Class

The UserDictionaryWordAddedEventArgs class provides data for the UserDictionaryWordAdded event in TX Spell .NET for Windows Forms and WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class UserDictionaryWordAddedEventArgs
[Visual Basic]
Public NotInheritable Class UserDictionaryWordAddedEventArgs

Properties

Property | Description
AddedWord | Gets the word that was added to the UserDictionary.
UserDictionary | Gets the UserDictionary where the word was added to.


TXTextControl.Proofing.UserDictionaryWordAddedEventArgs.UserDictionary Property

Gets the UserDictionary where the word was added to.

Syntax

[C#]
public Proofing.UserDictionary UserDictionary { get; }
[Visual Basic]
Public ReadOnly Property UserDictionary() As Proofing.UserDictionary

Limitations

Read only.

>> TXTextControl.Proofing.UserDictionaryWordAddedEventArgs.AddedWord Property


TXTextControl.Proofing.UserDictionaryWordAddedEventArgs.AddedWord Property

Gets the word that was added to the UserDictionary.

Syntax

[C#]
public string AddedWord { get; }
[Visual Basic]
Public ReadOnly Property AddedWord() As String

Limitations

Read only.

<< TXTextControl.Proofing.UserDictionaryWordAddedEventArgs.UserDictionary Property


TXTextControl.Proofing.UserDictionaryWordRemovedEventArgs Class

The UserDictionaryWordRemovedEventArgs class provides data for the UserDictionaryWordRemoved event in TX Spell .NET Windows Forms and WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class UserDictionaryWordRemovedEventArgs
[Visual Basic]
Public NotInheritable Class UserDictionaryWordRemovedEventArgs

Properties

Property | Description
RemovedWord | Gets the word that was removed from the UserDictionary.
UserDictionary | Gets the UserDictionary the word was removed from.


TXTextControl.Proofing.UserDictionaryWordRemovedEventArgs.UserDictionary Property

Gets the UserDictionary the word was removed from.

Syntax

[C#]
public Proofing.UserDictionary UserDictionary { get; }
[Visual Basic]
Public ReadOnly Property UserDictionary() As Proofing.UserDictionary

Limitations

Read only.

>> TXTextControl.Proofing.UserDictionaryWordRemovedEventArgs.RemovedWord Property


TXTextControl.Proofing.UserDictionaryWordRemovedEventArgs.RemovedWord Property

Gets the word that was removed from the UserDictionary.

Syntax

[C#]
public string RemovedWord { get; }
[Visual Basic]
Public ReadOnly Property RemovedWord() As String

Limitations

Read only.

<< TXTextControl.Proofing.UserDictionaryWordRemovedEventArgs.UserDictionary Property


TXTextControl.WPF.Proofing.DialogButton Class

The DialogButton class represents a button of the built-in SpellCheckDialog. Objects of this class can be added or removed to the dialog by modifying the SpellCheckDialog.IgnoreButtons, SpellCheckDialog.ChangeButtons and SpellCheckDialog.OptionButtons dialog button collections.

Introduced: 3.0.

Syntax

[C#]
public sealed class DialogButton
[Visual Basic]
Public NotInheritable Class DialogButton

Constructors

Constructor | Description
DialogButton | Initializes a new instance of the DialogButton class.

Properties

Property | Description
Enabled | Gets or sets a value indicating whether the DialogButton can respond to user interaction.
FontFamily | Gets or sets the font family of the text displayed by the DialogButton.
FontSize | Gets or sets the font size of the text displayed by the DialogButton.
FontStyle | Gets or sets the font style of the text displayed by the DialogButton.
FontWeight | Gets or sets the font weight of the text displayed by the DialogButton.
IsDeleteButton | Gets or sets a value specifying the DialogButton text.
IsUndoEditButton | Gets or sets a value specifying the DialogButton text.
Text | Gets or sets the text displayed by the DialogButton.
Type | Gets a value of type ButtonType which is specified for the DialogButton.


TXTextControl.WPF.Proofing.DialogButton Constructor

Initializes a new instance of the DialogButton class.

Syntax

[C#]
public DialogButton(Proofing.TXSpell.ButtonType type);
[Visual Basic]
Public Sub New(type As Proofing.TXSpell.ButtonType)
Parameter | Description
type | Specifies one of the ButtonType values.

>> TXTextControl.WPF.Proofing.DialogButton.Enabled Property


TXTextControl.WPF.Proofing.DialogButton.Enabled Property

Gets or sets a value indicating whether the DialogButton can respond to user interaction.

Syntax

[C#]
public bool Enabled { get; set; }
[Visual Basic]
Public Property Enabled() As Boolean


TXTextControl.WPF.Proofing.DialogButton.FontFamily Property

Gets or sets the font family of the text displayed by the DialogButton.

Syntax

[C#]
public System.Windows.Media.FontFamily FontFamily { get; set; }
[Visual Basic]
Public Property FontFamily() As System.Windows.Media.FontFamily


TXTextControl.WPF.Proofing.DialogButton.FontSize Property

Gets or sets the font size of the text displayed by the DialogButton.

Syntax

[C#]
public double FontSize { get; set; }
[Visual Basic]
Public Property FontSize() As Double


TXTextControl.WPF.Proofing.DialogButton.FontStyle Property

Gets or sets the font style of the text displayed by the DialogButton.

Syntax

[C#]
public System.Windows.FontStyle FontStyle { get; set; }
[Visual Basic]
Public Property FontStyle() As System.Windows.FontStyle


TXTextControl.WPF.Proofing.DialogButton.FontWeight Property

Gets or sets the font weight of the text displayed by the DialogButton.

Syntax

[C#]
public System.Windows.FontWeight FontWeight { get; set; }
[Visual Basic]
Public Property FontWeight() As System.Windows.FontWeight


TXTextControl.WPF.Proofing.DialogButton.IsDeleteButton Property

Gets or sets a value specifying the DialogButton text. The behavior changes to a Delete button, if the incorrect word (TXTextControl.MisspelledWord) is a duplicated word (TXTextControl.MisspelledWord.IsDuplicate).

Syntax

[C#]
public bool IsDeleteButton { get; set; }
[Visual Basic]
Public Property IsDeleteButton() As Boolean


TXTextControl.WPF.Proofing.DialogButton.IsUndoEditButton Property

Gets or sets a value specifying the DialogButton text. The behavior changes to an Undo Edit button, if the preview text of the SpellCheckDialog is manually modified. When no button in the dialog is set to true, the preview text is not editable.

Syntax

[C#]
public bool IsUndoEditButton { get; set; }
[Visual Basic]
Public Property IsUndoEditButton() As Boolean


TXTextControl.WPF.Proofing.DialogButton.Text Property

Gets or sets the text displayed by the DialogButton.

Syntax

[C#]
public string Text { get; set; }
[Visual Basic]
Public Property Text() As String


TXTextControl.WPF.Proofing.DialogButton.Type Property

Gets a value of type ButtonType which is specified for the DialogButton.

Syntax

[C#]
public Proofing.TXSpell.ButtonType Type { get; }
[Visual Basic]
Public ReadOnly Property Type() As Proofing.TXSpell.ButtonType

Limitations

Read only.

<< TXTextControl.WPF.Proofing.DialogButton.Text Property


TXTextControl.WPF.Proofing.DialogButtonCollection Class

An instance of the DialogButtonCollection class contains all objects of type DialogButton that represent the dialog buttons of the built-in SpellCheckDialog. It is inherited from the abstract class System.Collections.CollectionBase and implements the System.Collections.IEnumerable and System.Collections.IEnumerator interfaces. For a list of properties, methods and events of these classes and interfaces see the .NET Framework reference.

Introduced: 3.0.

Syntax

[C#]
public sealed class DialogButtonCollection: CollectionBase, IEnumerable, IEnumerator
[Visual Basic]
Public NotInheritable Class DialogButtonCollection
  Inherits CollectionBase
  Implements IEnumerable
  Implements IEnumerator

Methods

Method | Description
Add | Adds an object of type DialogButton to the collection.
AddRange | Adds a collection of DialogButtons to the collection.
Item | Gets a DialogButton from the collection.
Remove | Removes an object of type DialogButton from the collection.


TXTextControl.WPF.Proofing.DialogButtonCollection.Add Method

Adds an object of type DialogButton to the collection.

Syntax

[C#]
public void Add(WPF.Proofing.DialogButton button);
[Visual Basic]
Public Sub Add(button As WPF.Proofing.DialogButton)
Parameter | Description
button | Specifies an object of type DialogButton.

Remarks

This method throws an exception when called while the SpellCheckDialog is open.

>> TXTextControl.WPF.Proofing.DialogButtonCollection.AddRange Method


TXTextControl.WPF.Proofing.DialogButtonCollection.AddRange Method

Adds a collection of DialogButtons to the collection.

Syntax

[C#]
public void AddRange(IEnumerable<WPF.Proofing.DialogButton> collection);
[Visual Basic]
Public Sub AddRange(collection As IEnumerable(Of WPF.Proofing.DialogButton))
Parameter | Description
collection | Specifies the collection of DialogButtons.

Remarks

This method throws an exception when called while the SpellCheckDialog is open.


TXTextControl.WPF.Proofing.DialogButtonCollection.Item Property

Gets a DialogButton from the collection. This property is the indexer for the DialogButtonCollection class.

Syntax

[C#]
public WPF.Proofing.DialogButton this [int number] { get; }
[Visual Basic]
Public Default ReadOnly Property Item(number As Integer) As WPF.Proofing.DialogButton
Parameter | Description
number | The zero-based index of the DialogButton.

Return Value

The object of the type DialogButton at the specified index.


TXTextControl.WPF.Proofing.DialogButtonCollection.Remove Method

Removes an object of type DialogButton from the collection.

Syntax

[C#]
public void Remove(WPF.Proofing.DialogButton button);
[Visual Basic]
Public Sub Remove(button As WPF.Proofing.DialogButton)
Parameter | Description
button | Specifies an object of type DialogButton.

Remarks

This method throws an exception when called while the SpellCheckDialog is open.

<< TXTextControl.WPF.Proofing.DialogButtonCollection.Item Property


TXTextControl.WPF.Proofing.DialogButtonEventArgs Class

The DialogButtonEventArgs class provides data for the TXSpellChecker.DialogButtonClicked event in TX Spell .NET for WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class DialogButtonEventArgs
[Visual Basic]
Public NotInheritable Class DialogButtonEventArgs

Properties

Property | Description
DialogButton | Gets the clicked DialogButton.
StateManager | Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.


TXTextControl.WPF.Proofing.DialogButtonEventArgs.DialogButton Property

Gets the clicked DialogButton.

Syntax

[C#]
public WPF.Proofing.DialogButton DialogButton{ get; }
[Visual Basic]
Public ReadOnly Property DialogButton() As WPF.Proofing.DialogButton

Limitations

Read only.

>> TXTextControl.WPF.Proofing.DialogButtonEventArgs.StateManager Property


TXTextControl.WPF.Proofing.DialogButtonEventArgs.StateManager Property

Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.

Syntax

[C#]
public WPF.Proofing.SpellCheckDialogStateManager StateManager { get; }
[Visual Basic]
Public ReadOnly Property StateManager() As WPF.Proofing.SpellCheckDialogStateManager

Limitations

Read only.

<< TXTextControl.WPF.Proofing.DialogButtonEventArgs.DialogButton Property


TXTextControl.WPF.Proofing.MenuItem Class

The MenuItem class provides a method to build a menu strip with the most common TX Spell .NET features. An array of these items is created by calling the TXSpellChecker.GetMenuItems method. Clicking a MenuItem results in a specific action that depends on the WPF.Proofing.MenuItem.Type property. The class is inherited from the System.Windows.Controls.MenuItem class.

Introduced: 3.0.

Syntax

[C#]
public sealed class MenuItem
[Visual Basic]
Public NotInheritable Class MenuItem

Properties

Property | Description
Type | Gets the type of the MenuItem.


TXTextControl.WPF.Proofing.MenuItem.Type Property

Gets the type of the MenuItem.

Syntax

[C#]
public Proofing.TXSpell.MenuItemType Type { get; }
[Visual Basic]
Public ReadOnly Property Type() As Proofing.TXSpell.MenuItemType

Limitations

Read only.


TXTextControl.WPF.Proofing.MenuItemClickedEventArgs Class

The MenuItemClickedEventArgs class provides data for the TXSpellChecker.MenuItemClicked event in TX Spell .NET for WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class MenuItemClickedEventArgs
[Visual Basic]
Public NotInheritable Class MenuItemClickedEventArgs

Properties

Property | Description
MenuItem | Gets the clicked MenuItem.


TXTextControl.WPF.Proofing.MenuItemClickedEventArgs.MenuItem Property

Gets the clicked MenuItem.

Syntax

[C#]
public WPF.Proofing.MenuItem MenuItem { get; }
[Visual Basic]
Public ReadOnly Property MenuItem() As WPF.Proofing.MenuItem

Limitations

Read only.


TXTextControl.WPF.Proofing.OptionsDialogOpeningEventArgs Class

The OptionsDialogOpeningEventArgs class provides data for the TXSpellChecker.OptionsDialogOpening event in TXSpell for WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class OptionsDialogOpeningEventArgs
[Visual Basic]
Public Sealed Class OptionsDialogOpeningEventArgs

Properties

Property | Description
Cancel | Gets or sets a value indicating whether the event is canceled or not.


TXTextControl.WPF.Proofing.OptionsDialogOpeningEventArgs.Cancel Property

Gets or sets a value indicating whether the event is canceled or not.

Syntax

[C#]
public bool Cancel { get; set; }
[Visual Basic]
Public Property Cancel() As Boolean


TXTextControl.WPF.Proofing.Preview Class

The Preview class describes and handles attributes of the SpellCheckDialog's preview component. An instance of this class is provided by the SpellCheckDialog.Preview property in TX Spell .NET for WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class Preview
[Visual Basic]
Public NotInheritable Class Preview

Properties

Property | Description
Editable | Gets or sets the value specifying whether the SpellCheckDialog preview component is editable or not.
IncorrectWordColor | Gets or sets the color to colorize the current incorrect or misspelled (TXTextControl.MisspelledWord) word in the SpellCheckDialog preview component.


TXTextControl.WPF.Proofing.Preview.Editable Property

Gets or sets the value specifying whether the SpellCheckDialog preview component is editable or not. The default value is true.

Syntax

[C#]
public bool Editable { get; set; }
[Visual Basic]
Public Property Editable() As Boolean

>> TXTextControl.WPF.Proofing.Preview.IncorrectWordColor Property


TXTextControl.WPF.Proofing.Preview.IncorrectWordColor Property

Gets or sets the color to colorize the current incorrect or misspelled (TXTextControl.MisspelledWord) word in the SpellCheckDialog preview component. The default value is System.Windows.Media.Colors.Red.

Syntax

[C#]
public System.Windows.Media.Color IncorrectWordColor { get; set; }
[Visual Basic]
Public Property IncorrectWordColor() As System.Windows.Media.Color

<< TXTextControl.WPF.Proofing.Preview.Editable Property


TXTextControl.WPF.Proofing.ShowDialogSettings Class

The ShowDialogSettings class provides the possibility to determine the start position and the owner of the built-in options or spell check dialog. To specify these settings for the spell check dialog, the TXSpellChecker.SpellChecker.ShowDialogSettings property is provided. The options dialog can be modified by setting an instance of the ShowDialogSettings class as a parameter to the OptionsDialog method.

Introduced: 9.0.

Syntax

[C#]
public class ShowDialogSettings
[Visual Basic]
Public Class ShowDialogSettings

Properties

Property | Description
Location | Defines the starting location of the dialog if the StartPosition property is set to TXSpell.DialogStartPosition.Manual.
Owner | Gets or sets the System.Windows.Window that represents the top-level window that will own the dialog form.
StartPosition | Gets or sets the starting position of the form at run time.


TXTextControl.WPF.Proofing.ShowDialogSettings.Location Property

Defines the starting location of the dialog if the StartPosition property is set to TXSpell.DialogStartPosition.Manual. The default value is null

Syntax

[C#]
public System.Windows.Point? Location { get; set; }
[Visual Basic]
Public Property Location() As System.Windows.Point?

>> TXTextControl.WPF.Proofing.ShowDialogSettings.Owner Property


TXTextControl.WPF.Proofing.ShowDialogSettings.Owner Property

Gets or sets the System.Windows.Window that represents the top-level window that will own the dialog form. The default value is null.

Syntax

[C#]
public System.Windows.Window Owner { get; set; }
[Visual Basic]
Public Property Owner() As System.Windows.Window


TXTextControl.WPF.Proofing.ShowDialogSettings.StartPosition Property

Gets or sets the starting position of the form at run time. The default value is TXSpell.DialogStartPosition.CenterScreen.

Syntax

[C#]
public TXSpell.DialogStartPosition StartPosition { get; set; }
[Visual Basic]
Public Property StartPosition() As TXSpell.DialogStartPosition

<< TXTextControl.WPF.Proofing.ShowDialogSettings.Owner Property


TXTextControl.WPF.Proofing.SpellCheckDialog Class

The SpellCheckDialog class provides a method to modify and show the built-in spell check dialog.

Introduced: 3.0.

Syntax

[C#]
public sealed class SpellCheckDialog
[Visual Basic]
Public NotInheritable Class SpellCheckDialog

Properties

Property | Description
AcceptButton | Gets or sets the dialog button that is used as the SpellCheckDialog's accept button.
ChangeButtons | Gets a collection of all dialog buttons that are located to the right of the SpellCheckDialog's suggestion list.
ChangeInAllTextParts | Gets or sets a value indicating whether the SpellCheckDialog change operation is applied in all text parts (TXTextControl.WPF.TextControl.TextParts).
CloseOnFinished | Gets or sets a value specifying whether the SpellCheckDialog is closed on completing the spell checking.
FontFamily | Gets or sets the font family for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.
FontSize | Gets or sets the font size for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.
FontStyle | Gets or sets the font style for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.
FontWeight | Gets or sets the font weight for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.
HideSelection | Gets or sets a value indicating whether the selected text in the TXTextControl.WPF.TextControl remains highlighted while the SpellCheckDialog is open.
IgnoreButtons | Gets a collection of all dialog buttons that are located to the right of the SpellCheckDialog's preview component.
IgnoreInAllTextParts | Gets or sets a value indicating whether the SpellCheckDialog ignore operation should be applied in all text parts (TXTextControl.WPF.TextControl.TextParts).
Location | Returns the point that represents the upper-left corner of the SpellCheckDialog window in screen coordinates.
OptionButtons | Gets a collection of all dialog buttons that are located below the SpellCheckDialog's suggestion dictionary combo box.
Preview | Gets the SpellCheckDialog's Preview instance.
ShowDialogSettings | Gets or sets an instance of the ShowDialogSettings class to determine the SpellCheckDialog window's start position and owner.
ShowMessageBoxes | Gets or sets a value indicating whether the dialog should invoke built-in message boxes that inform the user that the spell checking is completed or that a chosen word is not found in one of the suggestion dictionaries.
SuggestionDictionaryComboBox | Gets the SpellCheckDialog's SuggestionDictionaryComboBox instance.
SuggestionList | Gets the SpellCheckDialog's SuggestionList instance.

Methods

Method | Description
Show | Overloaded. Invokes the built-in dialog box for checking incorrect or misspelled (TXTextControl.WPF.TextControl.MisspelledWords) words.


TXTextControl.WPF.Proofing.SpellCheckDialog.AcceptButton Property

Gets or sets the dialog button that is used as the SpellCheckDialog's accept button. The default value is the Ignore Once button.

Syntax

[C#]
public WPF.Proofing.DialogButton AcceptButton { get; set; }
[Visual Basic]
Public Property AcceptButton() As WPF.Proofing.DialogButton

>> TXTextControl.WPF.Proofing.SpellCheckDialog.ChangeInAllTextParts Property


TXTextControl.WPF.Proofing.SpellCheckDialog.ChangeInAllTextParts Property

Gets or sets a value indicating whether the SpellCheckDialog change operation is applied in all text parts (TXTextControl.WPF.TextControl.TextParts). The default value is true.

Syntax

[C#]
public bool ChangeInAllTextParts { get; set; }
[Visual Basic]
Public Property ChangeInAllTextParts() As Boolean

Remarks

This parameter is only executable, if the SpellCheckDialog is connected to an object of type TXTextControl.WPF.TextControl.


TXTextControl.WPF.Proofing.SpellCheckDialog.CloseOnFinished Property

Gets or sets a value specifying whether the SpellCheckDialog is closed on completing the spell checking. The default value is true.

Syntax

[C#]
public bool CloseOnFinished { get; set; }
[Visual Basic]
Public Property CloseOnFinished() As Boolean


TXTextControl.WPF.Proofing.SpellCheckDialog.FontFamily Property

Gets or sets the font family for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.

Syntax

[C#]
public System.Windows.Media.FontFamily FontFamily { get; set; }
[Visual Basic]
Public Property FontFamily() As public System.Windows.Media.FontFamily


TXTextControl.WPF.Proofing.SpellCheckDialog.FontSize Property

Gets or sets the font size for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.

Syntax

[C#]
public double FontSize { get; set; }
[Visual Basic]
Public Property FontFamily() As public Double


TXTextControl.WPF.Proofing.SpellCheckDialog.FontStyle Property

Gets or sets the font style for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.

Syntax

[C#]
public System.Windows.FontStyle FontStyle { get; set; }
[Visual Basic]
Public Property FontStyle() As public System.Windows.FontStyle


TXTextControl.WPF.Proofing.SpellCheckDialog.FontWeight Property

Gets or sets the font weight for the text displayed by the SpellCheckDialog labels, the preview, suggestion list, suggestion dictionary combo box and the cancel button.

Syntax

[C#]
public System.Windows.FontWeight FontWeight { get; set; }
[Visual Basic]
Public Property FontWeight() As public System.Windows.FontWeight


TXTextControl.WPF.Proofing.SpellCheckDialog.HideSelection Property

Gets or sets a value indicating whether the selected text in the TXTextControl.WPF.TextControl remains highlighted while the SpellCheckDialog is open. The default value is false.

Syntax

[C#]
public bool HideSelection { get; set; }
[Visual Basic]
Public Property HideSelection() As Boolean

Remarks

This parameter is only executable, if the SpellCheckDialog is connected to an object of type TXTextControl.WPF.TextControl.


TXTextControl.WPF.Proofing.SpellCheckDialog.IgnoreInAllTextParts Property

Gets or sets a value indicating whether the SpellCheckDialog ignore operation should be applied in all text parts (TXTextControl.WPF.TextControl.TextParts). The default value is true.

Syntax

[C#]
public bool IgnoreInAllTextParts { get; set; }
[Visual Basic]
Public Property IgnoreInAllTextParts() As Boolean

Remarks

This parameter is only executable, if the SpellCheckDialog is connected to an object of type TXTextControl.WPF.TextControl.


TXTextControl.WPF.Proofing.SpellCheckDialog.Location Property

Returns the point that represents the upper-left corner of the SpellCheckDialog window in screen coordinates.

Introduced: 9.0.

Syntax

[C#]
public System.Windows.Point? Location { get; }
[Visual Basic]
Public ReadOnly Property Location() As System.Windows.Point?

Remarks

The property returns null, if the dialog was not shown yet.

Limitations

Read only.

<< TXTextControl.WPF.Proofing.SpellCheckDialog.IgnoreInAllTextParts Property | >> TXTextControl.WPF.Proofing.SpellCheckDialog.ShowDialogSettings Property


TXTextControl.WPF.Proofing.SpellCheckDialog.ShowDialogSettings Property

Gets or sets an instance of the ShowDialogSettings class to determine the SpellCheckDialog window's start position and owner.

Introduced: 9.0.

Syntax

[C#]
public Proofing.ShowDialogSettings ShowDialogSettings{ get; }
[Visual Basic]
Public ReadOnly Property ShowDialogSettings() As Proofing.ShowDialogSettings


TXTextControl.WPF.Proofing.SpellCheckDialog.OptionButtons Property

Gets a collection of all dialog buttons that are located below the SpellCheckDialog's suggestion dictionary combo box. The property's value is an object of type DialogButtonCollection and can be modified by using its methods and properties. The default content of that collection is a button of type Options.

Syntax

[C#]
public WPF.Proofing.DialogButtonCollection OptionButtons{ get; }
[Visual Basic]
Public ReadOnly Property OptionButtons() As WPF.Proofing.DialogButtonCollection

Limitations

Read only.


TXTextControl.WPF.Proofing.SpellCheckDialog.Preview Property

Gets the SpellCheckDialog's Preview instance. This property describes and handles attributes of the spell check dialog's preview component.

Syntax

[C#]
public WPF.Proofing.Preview Preview{ get; }
[Visual Basic]
Public ReadOnly Property Preview() As WPF.Proofing.Preview

Limitations

Read only.


TXTextControl.WPF.Proofing.SpellCheckDialog.IgnoreButtons Property

Gets a collection of all dialog buttons that are located to the right of the SpellCheckDialog's preview component. The property's value is an object of type DialogButtonCollection and can be modified by using its methods and properties. The default content of that collection are buttons of type 'Ignore', 'IgnoreAll' and 'AddToDictionary'.

Syntax

[C#]
public WPF.Proofing.DialogButtonCollection IgnoreButtons{ get; }
[Visual Basic]
Public ReadOnly Property IgnoreButtons() As WPF.Proofing.DialogButtonCollection

Limitations

Read only.


TXTextControl.WPF.Proofing.SpellCheckDialog.Show Method

Invokes the built-in dialog box for checking incorrect or misspelled (TXTextControl.WPF.TextControl.MisspelledWords) words. The first implementation opens the spell check dialog for checking of the TXSpellChecker.IncorrectWords collection in TX Spell for WPF. To connect the SpellCheckDialog with an object of type TXTextControl.WPF.TextControl, the Show method provides the third implementation. At both implementations, the dialog's selected suggestion dictionary is specified through the SuggestionDictionaryComboBox.SuggestionDictionary property. The second and the fourth implementation can be used to invoke the dialog with another suggestion dictionary.

Show(Window)

Invokes the built-in dialog box for correcting incorrect words of the TXSpellChecker.IncorrectWords collection in TXSpell for WPF. The SuggestionDictionaryComboBox.SuggestionDictionary is selected to create suggestions.

[C#]
public void Show(System.Windows.Window owner);
[Visual Basic]
Public Sub Show(owner AS System.Windows.Window)
Parameter | Description
owner | Any object that implements System.Windows.Window and represents the top-level window that owns this dialog.

Show(Window, Dictionary)

Invokes the built-in dialog box for checking incorrect words of the TXSpellChecker.IncorrectWords collection in TXSpell for WPF. The specified suggestion dictionary is selected to create suggestions.

[C#]
public void Show(System.Windows.Window owner, Proofing.Dictionary suggestionDictionary);
[Visual Basic]
Public Sub Show(owner AS System.Windows.Window, suggestionDictionary As Proofing.Dictionary)
Parameter | Description
owner | Any object that implements System.Windows.Window and represents the top-level window that owns this dialog.
suggestionDictionary | Specifies the dictionary used for creating suggestions. This parameter is only useful, if more than one dictionary is added to the spellchecker's dictionary collection.

Show(Object)

Invokes the built-in dialog box for checking misspelled words (TXTextControl.WPF.TextControl.MisspelledWords) of a specific TextControl (TXTextControl.WPF.TextControl). The SuggestionDictionaryComboBox.SuggestionDictionary is selected to create suggestions.

[C#]
public void Show(object textControl);
[Visual Basic]
Public Sub Show(textControl As Object)
Parameter | Description
textControl | Specifies the object of type TXTextControl.WPF.TextControl that is connected to the dialog.

Show(Object, Dictionary)

Invokes the built-in dialog box for checking misspelled words (TXTextControl.WPF.TextControl.MisspelledWords) of a specific TextControl (TXTextControl.WPF.TextControl). The specified suggestion dictionary is selected to create suggestions.

[C#]
public void Show(object textControl, Proofing.Dictionary suggestionDictionary);
[Visual Basic]
Public Sub Show(textControl As Object, suggestionDictionary As Proofing.Dictionary)
Parameter | Description
textControl | Specifies the object of type TXTextControl.WPF.TextControl that is connected to the dialog.
suggestionDictionary | Specifies the dictionary used for creating suggestions. This parameter is only useful, if more than one dictionary is added to the spellchecker's dictionary collection.


TXTextControl.WPF.Proofing.SpellCheckDialog.ShowMessageBoxes Property

Gets or sets a value indicating whether the dialog should invoke built-in message boxes that inform the user that the spell checking is completed or that a chosen word is not found in one of the suggestion dictionaries. The default value is true.

Syntax

[C#]
public bool ShowMessageBoxes { get; set; }
[Visual Basic]
Public Property ShowMessageBoxes() As Boolean


TXTextControl.WPF.Proofing.SpellCheckDialog.SuggestionDictionaryComboBox Property

Gets the SpellCheckDialog's SuggestionDictionaryComboBox instance. This property describes and handles attributes of the spell check dialog's suggestion dictionary combo box.

Syntax

[C#]
public WPF.Proofing.SuggestionDictionaryComboBox SuggestionDictionaryComboBox{ get; }
[Visual Basic]
Public ReadOnly Property SuggestionDictionaryComboBox() As WPF.Proofing.SuggestionDictionaryComboBox

Limitations

Read only.


TXTextControl.WPF.Proofing.SpellCheckDialog.SuggestionList Property

Gets the SpellCheckDialog's SuggestionList instance. This property describes and handles attributes of the spell check dialog's suggestion list.

Syntax

[C#]
public WPF.Proofing.SuggestionList SuggestionList{ get; }
[Visual Basic]
Public ReadOnly Property SuggestionList() As WPF.Proofing.SuggestionList

Limitations

Read only.

<< TXTextControl.WPF.Proofing.SpellCheckDialog.SuggestionDictionaryComboBox Property | >> TXTextControl.WPF.Proofing.SpellCheckDialog.ChangeButtons Property


TXTextControl.WPF.Proofing.SpellCheckDialog.ChangeButtons Property

Gets a collection of all dialog buttons that are located to the right of the SpellCheckDialog's suggestion list. The property's value is an object of type DialogButtonCollection and can be modified by using its methods and properties. The default content of that collection are buttons of type Change and ChangeAll.

Syntax

[C#]
public WPF.Proofing.DialogButtonCollection ChangeButtons{ get; }
[Visual Basic]
Public ReadOnly Property ChangeButtons() As WPF.Proofing.DialogButtonCollection

Limitations

Read only.

<< TXTextControl.WPF.Proofing.SpellCheckDialog.SuggestionList Property


TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs Class

The SpellCheckDialogClosingEventArgs class provides data for the TXSpellChecker.SpellCheckDialogClosing event in TX Spell .NET for WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class SpellCheckDialogOpeningEventArgs
[Visual Basic]
Public NotInheritable Class SpellCheckDialogOpeningEventArgs

Properties

Property | Description
Cancel | Gets or sets a value indicating whether the event is canceled or not.
StateManager | Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.


TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs.Cancel Property

Gets or sets a value indicating whether the event is canceled or not.

Syntax

[C#]
public bool Cancel { get; set; }
[Visual Basic]
Public Property Cancel() As Boolean

>> TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs.StateManager Property


TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs.StateManager Property

Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.

Syntax

[C#]
public WPF.Proofing.SpellCheckDialogStateManager StateManager { get; }
[Visual Basic]
Public ReadOnly Property StateManager() As WPF.Proofing.SpellCheckDialogStateManager

Limitations

Read only.

<< TXTextControl.WPF.Proofing.SpellCheckDialogClosingEventArgs.Cancel Property


TXTextControl.WPF.Proofing.SpellCheckDialogOpeningEventArgs Class

The SpellCheckDialogOpeningEventArgs class provides data for the TXSpellChecker.SpellCheckDialogOpening event in TX Spell for WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class SpellCheckDialogOpeningEventArgs
[Visual Basic]
Public NotInheritable Class SpellCheckDialogOpeningEventArgs

Properties

Property | Description
StateManager | Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.


TXTextControl.WPF.Proofing.SpellCheckDialogOpeningEventArgs.StateManager Property

Gets the SpellCheckDialogStateManager that provides methods and properties to get or set the next object of type IncorrectWord or TXTextControl.MisspelledWord that is handled by the SpellCheckDialog.

Syntax

[C#]
public WPF.Proofing.SpellCheckDialogStateManager StateManager { get; }
[Visual Basic]
Public ReadOnly Property StateManager() As WPF.Proofing.SpellCheckDialogStateManager

Limitations

Read only.


TXTextControl.WPF.Proofing.SpellCheckDialogStateManager Class

Provides methods and properties for the StateManager property that is provided by the SpellCheckDialogOpeningEventArgs, DialogButtonEventArgs and the SpellCheckDialogClosingEventArgs in TX Spell .NET for WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class SpellCheckDialogStateManager
[Visual Basic]
Public NotInheritable Class SpellCheckDialogStateManager

Properties

Property | Description
NextIFormattedText | Gets the next object of type TXTextControl.IFormattedText that contains the next misspelled word (TXTextControl.MisspelledWord).
NextIncorrectWord | Gets an object of type IncorrectWord that is handled next by the SpellCheckDialog.
NextMisspelledWord | Gets an object of type TXTextControl.MisspelledWord that is handled next by the SpellCheckDialog.

Methods

Method | Description
Close | Closes the spell check dialog.
SetNext | Overloaded. Provides a method to set a specific incorrect or misspelled (TXTextControl.MisspelledWord) word, that should be handled next by the SpellCheckDialog.


TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.Close Method

Closes the spell check dialog.

Syntax

[C#]
public void Close();
[Visual Basic]
Public Sub Close()

Remarks

An exception is thrown, if this method is called by the SpellCheckDialogClosingEventArgs.StateManager property.

>> TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.SetNext Method


TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.SetNext Method

Provides a method to set a specific incorrect or misspelled (TXTextControl.MisspelledWord) word, that should be handled next by the SpellCheckDialog. Furthermore, a complete new text or an object of type TXTextControl.WPF.TextControl can be set to the SpellCheckDialog. A new incorrect word or misspelled word (TXTextControl.IFormattedText.MisspelledWords) collection is connected and handled.

SetNext(String)

Sets the text that is handled next by the SpellCheckDialog.

[C#]
public void SetNext(string text);
[Visual Basic]
Public Sub SetNext(text As String)
Parameter | Description
text | The text that is handled next by the SpellCheckDialog.

SetNext(IncorrectWord)

Sets the incorrect word that is handled next by the SpellCheckDialog.

[C#]
public void SetNext(Proofing.IncorrectWord incorrectWord);
[Visual Basic]
Public Sub SetNext(incorrectWord As Proofing.IncorrectWord)
Parameter | Description
incorrectWord | The object of type IncorrectWord that is handled next by the SpellCheckDialog. It must be part of the incorrect word collection that was created by calling the SetNext method with a string parameter or connected by invoking the SpellCheckDialog with the first or second overload of the TXSpellChecker.SpellCheckDialog.Show method.

SetNext(Object)

Sets an object of type TXTextControl.WPF.TextControl that is handled next by the SpellCheckDialog.

[C#]
public void SetNext(object textControl);
[Visual Basic]
Public Sub SetNext(textControl As Object)
Parameter | Description
textControl | The object of type TXTextControl.WPF.TextControl that is handled next by the SpellCheckDialog.

SetNext(Object, Object)

Sets an object of type TXTextControl.MisspelledWord that is handled next by the SpellCheckDialog.

[C#]
public void SetNext(object misspelledWord, object iFormattedText);
[Visual Basic]
Public Sub SetNext(misspelledWord As Object, iFormattedText As Object)
Parameter | Description
misspelledWord | The object of type TXTextControl.MisspelledWord that is handled next by the SpellCheckDialog.
iFormattedText | The object of type TXTextControl.IFormattedText that contains the misspelled word (TXTextControl.MisspelledWord).

Remarks

An exception is thrown for the second overload, if the SpellCheckDialog is connected to an instance of TXTextControl.WPF.TextControl.

An exception is thrown for the fourth overload, if the SpellCheckDialog is not connected to an instance of TXTextControl.WPF.TextControl whose TextPartCollection contains the IFormattedText parameter.

<< TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.Close Method | >> TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.NextIncorrectWord Property


TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.NextIncorrectWord Property

Gets an object of type IncorrectWord that is handled next by the SpellCheckDialog.

Syntax

[C#]
public Proofing.IncorrectWord NextIncorrectWord { get; }
[Visual Basic]
Public ReadOnly Property NextIncorrectWord() As Proofing.IncorrectWord

Remarks

An exception is thrown, if the SpellCheckDialog is connected to an object of type TXTextControl.WPF.TextControl.

Limitations

Read only.

<< TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.SetNext Method | >> TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.NextIFormattedText Property


TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.NextIFormattedText Property

Gets the next object of type TXTextControl.IFormattedText that contains the next misspelled word (TXTextControl.MisspelledWord).

Syntax

[C#]
public object NextIFormattedText { get; }
[Visual Basic]
Public ReadOnly Property NextIFormattedText() As Object

Remarks

An exception is thrown, if the SpellCheckDialog is not connected to an object of type TXTextControl.WPF.TextControl.

Limitations

Read only.

<< TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.NextIncorrectWord Property | >> TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.NextMisspelledWord Property


TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.NextMisspelledWord Property

Gets an object of type TXTextControl.MisspelledWord that is handled next by the SpellCheckDialog.

Syntax

[C#]
public object NextMisspelledWord { get; }
[Visual Basic]
Public ReadOnly Property NextMisspelledWord() As Object

Remarks

An exception is thrown, if the SpellCheckDialog is not connected with an object of type TXTextControl.WPF.TextControl.

Limitations

Read only.

<< TXTextControl.WPF.Proofing.SpellCheckDialogStateManager.NextIFormattedText Property


TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox Class

The SuggestionDictionaryComboBox class describes and handles attributes of the spell check dialog's suggestion dictionary combo box. An instance of that class is provided by the SpellCheckDialog.SuggestionDictionaryComboBox property in TX Spell .NET for WPF

Introduced: 3.0.

Syntax

[C#]
public sealed class SuggestionDictionaryComboBox
[Visual Basic]
Public NotInheritable Class SuggestionDictionaryComboBox

Properties

Property | Description
IsAllItemEnabled | Gets or sets a value indicating whether the SpellCheckDialog's dictionary combo box provides an All item that represents all dictionaries that are IsGetSuggestionsEnabled to create suggestions or not.
IsAllItemSelected | Gets or sets a value indicating whether the All item of the SpellCheckDialog's dictionary combobox is selected or not.
SuggestionDictionary | Gets or sets the dictionary that is currently selected as a suggestion dictionary.


TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox.IsAllItemEnabled Property

Gets or sets a value indicating whether the SpellCheckDialog's dictionary combo box provides an All item that represents all dictionaries that are IsGetSuggestionsEnabled to create suggestions or not. The All item is only provided, if the number of dictionaries, that are set to IsGetSuggestionsEnabled, is more than one. The default value is false.

Syntax

[C#]
public bool IsAllItemEnabled { get; set; }
[Visual Basic]
Public Property IsAllItemEnabled() As Boolean

>> TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox.IsAllItemSelected Property


TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox.IsAllItemSelected Property

Gets or sets a value indicating whether the All item of the SpellCheckDialog's dictionary combobox is selected or not. These properties can be set to true, if the SpellCheckDialog is not invoked or the SpellCheckDialog is opened, the number of dictionaries that are set to IsGetSuggestionsEnabled are more than one and the IsAllItemEnabled property is set to true. The default value is false.

Syntax

[C#]
public bool IsAllItemSelected { get; set; }
[Visual Basic]
Public Property IsAllItemSelected() As Boolean

<< TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox.IsAllItemEnabled Property | >> TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox.SuggestionDictionary Property


TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox.SuggestionDictionary Property

Gets or sets the dictionary that is currently selected as a suggestion dictionary. If the IsAllItemSelected property is set to true, the value is null.

Syntax

[C#]
public Proofing.Dictionary SuggestionDictionary { get; set; }
[Visual Basic]
Public Property SuggestionDictionary() As Proofing.Dictionary

<< TXTextControl.WPF.Proofing.SuggestionDictionaryComboBox.IsAllItemSelected Property


TXTextControl.WPF.Proofing.SuggestionList Class

The SuggestionList class describes and handles attributes of the SpellCheckDialog's suggestion list. An instance of this class is provided by the SpellCheckDialog.SuggestionList property in TX Spell .NET for WPF.

Introduced: 3.0.

Syntax

[C#]
public sealed class SuggestionList
[Visual Basic]
Public NotInheritable Class SuggestionList

Properties

Property | Description
IsNoSuggestionsItemEnabled | Gets or sets a value indicating whether a message is displayed in the SpellCheckDialog's suggestion list that informs the user that no suggestions could be created for the current incorrect word.
MaxSuggestions | Gets or sets the maximum number of suggestions that has to be determined.


TXTextControl.WPF.Proofing.SuggestionList.MaxSuggestions Property

Gets or sets the maximum number of suggestions that has to be determined. The default value is 10.

Syntax

[C#]
public int MaxSuggestions { get; set; }
[Visual Basic]
Public Property MaxSuggestions() As Integer

>> TXTextControl.WPF.Proofing.SuggestionList.IsNoSuggestionsItemEnabled Property


TXTextControl.WPF.Proofing.SuggestionList.IsNoSuggestionsItemEnabled Property

Gets or sets a value indicating whether a message is displayed in the SpellCheckDialog's suggestion list that informs the user that no suggestions could be created for the current incorrect word. The default value is true.

Syntax

[C#]
public bool IsNoSuggestionsItemEnabled { get; set; }
[Visual Basic]
Public Property IsNoSuggestionsItemEnabled() As Boolean

<< TXTextControl.WPF.Proofing.SuggestionList.MaxSuggestions Property


TXTextControl.WPF.Proofing.TXSpellChecker Class

The TXSpellChecker class implements a component with spell checking features. It allows to set general spell checking settings by using an options dialog, to invoke a customizable SpellCheckDialog that can be connected to different types of controls (e.g. TXTextControl.WPF.TextControl and System.Windows.Controls.RichtTextBox) and to create a spell checking context menu by using the TXSpellChecker.GetMenuItems method. Currently, TXTextControl (version 17.0 and better) provides the WPF.TextControl.SpellChecker Property to connect the TXSpellChecker with its TextControl component. To invoke the internal or an own spell check context menu on right-clicking a misspelled word, the WPF.TextControl.SpellCheckContextMenuStrip proeprty must be set. The following describes only the properties, methods and events defined through the TXSpellChecker class.

Syntax

[C#]
public sealed class TXSpellChecker
[Visual Basic]
Public NotInheritable Class TXSpellChecker

Constructors

Constructor | Description
TXSpellChecker | Overloaded. Initializes a new instance of the TXSpellChecker class.

Properties

Property | Description
AvailableDictionaries | Gets a list of all available dictionaries in the default dictionary folder.
AvailableHyphenationLists | Gets a list of all available hyphenation lists of the default hyphenation lists folder.
AvailableSynonymLists | Gets a list of all available synonym lists of the default synonym lists folder.
DetectableLanguageScopes | Gets or sets a list of all languages that are used to detect language scopes in a text.
Dictionaries | Gets a collection of all added and validated dictionaries.
DictionariesDirectoryPath | Gets or sets the path to the default dictionaries folder.
HyphenationLanguage | Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true.
HyphenationLists | Gets a collection of all added hyphenation dictionaries.
HyphenationListsDirectoryPath | Gets or sets the path to the default hyphenation lists folder.
IgnoreCase | Gets or sets a value of type IgnoreCaseSettings determining if and how the case of a word is ignored while spell checking.
IgnoreWord | Gets or sets a value of type IgnoreWordSettings determining when a word should not be spell checked.
IncorrectWords | Gets a collection of all incorrect words that were detected by the last call of the TXSpellChecker.Check method.
Language | Gets or sets the name of a dictionary that is located at the default dictionary folder. Using the Language property, the Dictionary.IsSelectedAsDefault property of the chosen dictionary is set to true.
LanguageRecognitionDirectoryPath | Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text.
LanguageScopes | Gets a collection of all detected language scopes.
SpellCheckDialog | Gets an object of type SpellCheckDialog that is used to modify and show the built-in SpellCheckDialog.
SpellingCorrectionUIProvider | Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.
Suggestions | Gets a collection of suggestions that were created by the last call of the TXSpellChecker.CreateSuggestions method.
SynonymLanguage | Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true.
SynonymLists | Gets a collection of all added synonym lists.
SynonymListsDirectoryPath | Gets or sets the path to the default synonym lists folder.

Methods

Method | Description
Check | Overloaded. Checks text for spelling errors and fills the IncorrectWordCollection at TXSpellChecker.IncorrectWords with all incorrect words.
Create | Initializes the resources of a newly instantiated TXSpellChecker object.
CreateSuggestions | Overloaded. Determines suggestions for a specific incorrect word by using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries and adds the results to the SuggestionCollection at TXSpellChecker.Suggestions. If no maximum number of suggestions is specified, all created suggestions are added to TXSpellChecker.Suggestions.
CreateSynonyms | Overloaded. Returns groups of synonyms that represent equivalent expressions for a specific text.
DetectLanguageScopes | Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpellChecker.LanguageScopes.
GetHyphenationPoint | Overloaded. Returns the next hyphenation point for a specific word right before a defined divide position.
GetHyphenationPoints | Overloaded. Returns an array of all hyphenation points for a word.
GetMenuItems | Overloaded. Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.
OptionsDialog | Overloaded. Invokes the built-in dialog box to define spell check, create suggestions and hyphenation and create synonyms settings..

Events

Event | Description
DialogButtonClicked | Occurs when a dialog button of the built-in SpellCheckDialog is clicked.
DictionaryAdded | Occurs when a dictionary is added to the TXSpellChecker.Dictionaries DictionaryCollection.
DictionaryRemoved | Occurs when a dictionary is removed from the TXSpellChecker.Dictionaries DictionaryCollection.
IncorrectWordChanging | Occurs when an object of type IncorrectWord is changing by spell check context menu or spell check dialog operations.
MenuItemClicked | Occurs when a MenuItem is clicked.
MisspelledWordChanging | Occurs when an object of type TXTextControl.MisspelledWord is changing by spell check context menu or spell check dialog operations.
OptionsDialogOpening | Occurs when the built-in options dialog is invoked by the TXSpellChecker.OptionsDialog method or clicking the Options... button of the built-in SpellCheckDialog.
SpellCheckDialogClosing | Occurs when the built-in spell check dialog is closing.
SpellCheckDialogOpening | Occurs when the built-in spell check dialog is invoked using the SpellCheckDialog.Show method.
UserDictionaryWordAdded | Occurs when a word is added to a user dictionary.
UserDictionaryWordRemoved | Occurs when a word is removed from a user dictionary.


TXTextControl.WPF.Proofing.TXSpellChecker Constructor

Initializes a new instance of the TXSpellChecker class.

TXSpellChecker()

Initializes a new instance of the TXSpellChecker class. For spell check operations, a dictionary is used that is defined through the TXSpellChecker.Language property.

[C#]
public TXSpellChecker();
[Visual Basic]
Public Sub New()

TXSpellChecker(String)

Initializes a new instance of the TXSpellChecker class. For spell check operations, a dictionary is used that corresponds to the specified language.

[C#]
public TXSpellChecker(string language);
[Visual Basic]
Public Sub New(language As String)
Parameter | Description
language | The name of a dictionary that is located in the default dictionary folder and is loaded as default dictionary. The parameter corresponds to the TXSpellChecker.Language property.

>> TXTextControl.WPF.Proofing.TXSpellChecker.AvailableDictionaries Property


TXTextControl.WPF.Proofing.TXSpellChecker.AvailableDictionaries Property

Gets a list of all available dictionaries in the default dictionary folder.

Introduced: 3.0.

Syntax

[C#]
public string[] AvailableDictionaries{ get; }
[Visual Basic]
Public ReadOnly Property AvailableDictionaries() As String()

Limitations

Read only.


TXTextControl.WPF.Proofing.TXSpellChecker.AvailableHyphenationLists Property

Gets a list of all available hyphenation lists of the default hyphenation lists folder.

Introduced: 4.0.

Syntax

[C#]
public string[] AvailableHyphenationLists{ get; }
[Visual Basic]
Public ReadOnly Property AvailableHyphenationLists() As String()

Limitations

Read only.

<< TXTextControl.WPF.Proofing.TXSpellChecker.AvailableDictionaries Property | >> TXTextControl.WPF.Proofing.TXSpellChecker.AvailableSynonymLists Property


TXTextControl.WPF.Proofing.TXSpellChecker.AvailableSynonymLists Property

Gets a list of all available synonym lists of the default synonym lists folder.

Introduced: 7.0.

Syntax

[C#]
public string[] AvailableSynonymLists{ get; }
[Visual Basic]
Public ReadOnly Property AvailableSynonymLists() As String()

Limitations

Read only.


TXTextControl.WPF.Proofing.TXSpellChecker.Check Method

Checks text for spelling errors and fills the IncorrectWordCollection at TXSpellChecker.IncorrectWords with all incorrect words. The first implementation uses selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries. The second implementation uses selected dictionaries of the TXSpellChecker.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used whose Dictionary.IsSpellCheckingEnabled properties are set to true.

Check(String)

Checks text for spelling errors using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries.

[C#]
public void Check(string text);
[Visual Basic]
Public Sub Check(text As String)
Parameter | Description
text | Specifies the text to spell check.

Check(String, CultureInfo)

Checks text for spelling errors using selected dictionaries of the TXSpellChecker.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void Check(string text, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub Check(text As String, language As System.Globalization.CultureInfo)
Parameter | Description
text | Specifies the text to spell check.
language | The language that is used to spell check the specified text.

Remarks

This method throws an exception, if called while the SpellCheckDialog is open.


TXTextControl.WPF.Proofing.TXSpellChecker.Create Method

Initializes the resources of a newly instantiated TXSpellChecker object. This method must be called before using the object. If TX Spell .NET is connected to a TXTextControl.WPF.TextControl instance, this method is called implicitely and must not be called separately.

Syntax

[C#]
public void Create();
[Visual Basic]
Public Sub Create()


TXTextControl.WPF.Proofing.TXSpellChecker.CreateSuggestions Method

Determines suggestions for a specific incorrect word by using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries and adds the results to the SuggestionCollection at TXSpellChecker.Suggestions. If no maximum number of suggestions is specified, all created suggestions are added to TXSpellChecker.Suggestions. Otherwise, only the first maximum number of suggestions are determined. The second and fourth implementation uses selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used whose Dictionary.IsGetSuggestionsEnabled properties are set to true.

CreateSuggestions(String)

Determines suggestions for a specific incorrect word.

[C#]
public void CreateSuggestions(string incorrectWord);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.

CreateSuggestions(String, CultureInfo)

Determines suggestions for a specific incorrect word using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void CreateSuggestions(string incorrectWord, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, language As System.Globalization.CultureInfo)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
language | The language that is used to create suggestions for the specified incorrect word.

CreateSuggestions(String, Int32)

Determines a maximum number of suggestions for a specific incorrect word.

[C#]
public void CreateSuggestions(string incorrectWord, int max);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, max As Integer)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
max | Specifies the maximum number of suggestions that has to be determined.

CreateSuggestions(String, Int32, CultureInfo)

Determines a maximum number of suggestions for a specific incorrect word using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

[C#]
public void CreateSuggestions(string incorrectWord, int max, System.Globalization.CultureInfo language);
[Visual Basic]
Public Sub CreateSuggestions(incorrectWord As String, max As Integer, language As System.Globalization.CultureInfo)
Parameter | Description
incorrectWord | Specifies the incorrect word that has to be determined for suggestions.
max | Specifies the maximum number of suggestions that has to be determined.
language | The language that is used to create suggestions for the specified incorrect word.


TXTextControl.WPF.Proofing.TXSpellChecker.CreateSynonyms Method

Returns groups of synonyms that represent equivalent expressions for a specific text. The first implementation uses selected synonym lists of the SynonymListCollection at TXSpellChecker.SynonymLists. The second implementation uses selected synonym lists of the TXSpellChecker.SynonymLists collection and the default synonym lists folder where the synonym list's language equals to the defined language parameter. The last overload creates synonym groups for a specific synonym list. Only those synonym lists are used whose SynonymList.IsCreateSynonymsEnabled properties are set to true.

Introduced: 7.0.

CreateSynonyms(String)

Returns synonyms for a specific text using the selected synonym lists of the SynonymListCollection at the TXSpellChecker.SynonymLists.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text);
[Visual Basic]
Public Function CreateSynonyms(text As String) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.

CreateSynonyms(String, CultureInfo)

Returns synonyms for a specific text using the selected synonym lists of the SynonymListCollection at the TXSpellChecker.SynonymLists and the default synonym lists folder where the synonym list's language equals to the defined language parameter.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function CreateSynonyms(text As String, language As System.Globalization.CultureInfo) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.
language | The language that is used to create synonyms for the specified text.

CreateSynonyms(String, SynonymList)

Returns synonyms for a specific text using a specific SynonymList.

[C#]
public Proofing.SynonymGroup[] CreateSynonyms(string text, Proofing.SynonymList synonymList);
[Visual Basic]
Public Function CreateSynonyms(text As String, synonymList As Proofing.SynonymList) As Proofing.SynonymGroup()
Parameter | Description
text | Specifies the text that has to be determined for synonyms.
synonymList | The synonymList that is used to create synonyms for the specified text.

<< TXTextControl.WPF.Proofing.TXSpellChecker.CreateSuggestions Method | >> TXTextControl.WPF.Proofing.TXSpellChecker.DetectableLanguageScopes Property


TXTextControl.WPF.Proofing.TXSpellChecker.DetectableLanguageScopes Property

Gets or sets a list of all languages that are used to detect language scopes in a text.

Introduced: 5.0.

Syntax

[C#]
public CultureInfo[] DetectableLanguageScopes{ get; set; }
[Visual Basic]
Public Property DetectableLanguageScopes() As CultureInfo()

Remarks

From the 10 most occurring native languages TX Spell supports Arabic, German, English, Spanish, French, Portuguese and Russian. These languages are set as default for detecting language scopes.


TXTextControl.WPF.Proofing.TXSpellChecker.DetectLanguageScopes Method

Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpellChecker.LanguageScopes.

Introduced: 5.0.

Syntax

[C#]
public void DetectLanguageScopes(string text);
[Visual Basic]
Public Sub DetectLanguageScopes(text As String)
Parameter | Description
text | Specifies the text where to detect language scopes.

Remarks

The languages that are used to detect language scopes in a text can be defined by the TXSpellChecker.DetectableLanguageScopes property.

<< TXTextControl.WPF.Proofing.TXSpellChecker.DetectableLanguageScopes Property | >> TXTextControl.WPF.Proofing.TXSpellChecker.DialogButtonClicked Event


TXTextControl.WPF.Proofing.TXSpellChecker.DialogButtonClicked Event

Occurs when a dialog button of the built-in SpellCheckDialog is clicked. The DialogButtonHandler receives an argument of type DialogButtonEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event WPF.Proofing.DialogButtonHandler DialogButtonClicked;
[Visual Basic]
Public Event DialogButtonClicked As WPF.Proofing.DialogButtonHandler


TXTextControl.WPF.Proofing.TXSpellChecker.Dictionaries Property

Gets a collection of all added and validated dictionaries. The property's value is an object of type DictionaryCollection.

Syntax

[C#]
public Proofing.DictionaryCollection Dictionaries{ get; }
[Visual Basic]
Public ReadOnly Property Dictionaries() As Proofing.DictionaryCollection

Limitations

Read only.


TXTextControl.WPF.Proofing.TXSpellChecker.DictionaryAdded Event

Occurs when a dictionary is added to the TXSpellChecker.Dictionaries DictionaryCollection. The DictionaryAddedHandler receives an argument of type DictionaryAddedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.DictionaryAddedHandler DictionaryAdded;
[Visual Basic]
Public Event DictionaryAdded As Proofing.DictionaryAddedHandler


TXTextControl.WPF.Proofing.TXSpellChecker.DictionaryRemoved Event

Occurs when a dictionary is removed from the TXSpellChecker.Dictionaries DictionaryCollection. The DictionaryRemovedHandler receives an argument of type DictionaryRemovedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.DictionaryRemovedHandler DictionaryRemoved;
[Visual Basic]
Public Event DictionaryRemoved As Proofing.DictionaryRemovedHandler


TXTextControl.WPF.Proofing.TXSpellChecker.DictionariesDirectoryPath Property

Gets or sets the path to the default dictionaries folder. The default value is "(Auto)" that determines the Dictionaries directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string DictionariesDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property DictionariesDirectoryPath() As String

<< TXTextControl.WPF.Proofing.TXSpellChecker.DictionaryRemoved Event | >> TXTextControl.WPF.Proofing.TXSpellChecker.HyphenationListsDirectoryPath Property


TXTextControl.WPF.Proofing.TXSpellChecker.HyphenationListsDirectoryPath Property

Gets or sets the path to the default hyphenation lists folder. The default value is "(Auto)" that determines the HyphenationLists directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string HyphenationListsDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property HyphenationListsDirectoryPath() As String

<< TXTextControl.WPF.Proofing.TXSpellChecker.DictionariesDirectoryPath Property | >> TXTextControl.WPF.Proofing.TXSpellChecker.GetHyphenationPoint Method


TXTextControl.WPF.Proofing.TXSpellChecker.GetHyphenationPoint Method

Returns the next hyphenation point for a specific word right before a defined divide position. Using the first implementation that point is caluclated by applying the default hyphenation list. The second implementation uses a hyphenation list of the TXSpellChecker.HyphenationLists collection or a list from the default hyphenation lists folder that corresponds to the specified language parameter (second implementation). If there is no hyphenation point before that divide position and the position is less the word length, the method returns 0. For divide positions greater than or equal to the number of word characters, the method returns the word length.

Introduced: 4.0.

GetHyphenationPoint(String, Int32)

Returns the next hyphenation point for a specific word right before a defined divide position. That point is calculated by using the default hyphenation list.

[C#]
public int GetHyphenationPoint(string word, int dividePosition);
[Visual Basic]
Public Function GetHyphenationPoint(ByVal word As String, ByVal dividePosition As Integer) As Integer
Parameter | Description
word | The word to hyphenate.
dividePosition | The defined divide position.

GetHyphenationPoint(String, Int32, CultureInfo)

Returns the next hyphenation point for a specific word right before a defined divide position. That point is calculated by using the hyphenation list that corresponds to the specified language parameter

[C#]
public int GetHyphenationPoint(string word, int dividePosition, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function GetHyphenationPoint(ByVal word As String, ByVal dividePosition As Integer, language As System.Globalization.CultureInfo) As Integer
Parameter | Description
word | The word to hyphenate.
dividePosition | The defined divide position.
language | The language, which is used to calculate the hyphenation point. If the TXSpellChecker.HyphenationLists collection does not contain a hyphenation list, where its language does not equal exactly to the defined language parameter, the default hyphenation lists folder is examined for such a list. In case no corresponding list was found, both, first the TXSpellChecker.HyphenationLists collection and finally the default hyphenation lists folder, are examined for a hyphenation list that equals roughly to specified language (e.g. the language parameter stands for English (USA) and the hyphenation list's language property represents English (Great Britain)).

Return Value

The next hyphenation point right before the defined divide position.

<< TXTextControl.WPF.Proofing.TXSpellChecker.HyphenationListsDirectoryPath Property | >> TXTextControl.WPF.Proofing.TXSpellChecker.GetHyphenationPoints Method


TXTextControl.WPF.Proofing.TXSpellChecker.GetHyphenationPoints Method

Returns an array of all hyphenation points for a word. Using the first implementation these points are calculated by applying the default hyphenation list. The second implementation uses a hyphenation list of the TXSpellChecker.HyphenationLists collection or a list from the default hyphenation lists folder that corresponds to the specified language parameter (second implementation).

Introduced: 4.0.

GetHyphenationPoints(String)

Returns an array of all hyphenation points for a word. These points are calculated by using the default hyphenation list.

[C#]
public int[] GetHyphenationPoints(string word);
[Visual Basic]
Public Function GetHyphenationPoints(ByVal word As String) As Integer()
Parameter | Description
word | The word to hyphenate.

GetHyphenationPoints(String, CultureInfo)

Returns an array of all hyphenation points for a word. These points are calculated by using the hyphenation list that corresponds to the specified language parameter

[C#]
public int[] GetHyphenationPoints(string word, System.Globalization.CultureInfo language);
[Visual Basic]
Public Function GetHyphenationPoints(ByVal word As String, language As System.Globalization.CultureInfo) As Integer()
Parameter | Description
word | The word to hyphenate.
language | The language, which is used to calculate the hyphenation points. If the TXSpellChecker.HyphenationLists collection does not contain a hyphenation list, where its language does not equal exactly to the defined language parameter, the default hyphenation lists folder is examined for such a list. In case no corresponding list was found, both, first the TXSpellChecker.HyphenationLists collection and finally the default hyphenation lists folder, are examined for a hyphenation list that equals roughly to specified language (e.g. the language parameter stands for English (USA) and the hyphenation list's language property represents English (Great Britain)).

Return Value

An array of all hyphenation points for the defined word.


TXTextControl.WPF.Proofing.TXSpellChecker.GetMenuItems Method

Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.

Introduced: 3.0.

GetMenuItems(Object, Object, Int32)

Returns an array of MenuItems for a specific object of type TXTextControl.MisspelledWord.

[C#]
public WPF.Proofing.MenuItem[] GetMenuItems(object misspelledWord, object textControl, int maxSuggestions);
[Visual Basic]
Public Function GetMenuItems(misspelledWord As Object, textControl As Object, maxSuggestions As Integer) As WPF.Proofing.MenuItem()
Parameter | Description
misspelledWord | The misspelled word of type TXTextControl.MisspelledWord for that the array of menu items are created.
textControl | The control of type TXTextControl.WPF.TextControl that contains the misspelled word.
maxSuggestions | The maximum number of suggestions that should be created for the incorrect word.

GetMenuItems(IncorrectWord, String, Int32)

Returns an array of MenuItems for a specific IncorrectWord.

[C#]
public WPF.Proofing.MenuItem[] GetMenuItems(Proofing.IncorrectWord incorrectWord, string sourceText, int maxSuggestions);
[Visual Basic]
Public Function GetMenuItems(incorrectWord As Proofing.IncorrectWord, sourceText As String, maxSuggestions As Integer) As WPF.Proofing.MenuItem()
Parameter | Description
incorrectWord | The misspelled word of type IncorrectWord for that the array of menu items is created.
sourceText | The text that contains the misspelled word.
maxSuggestions | The maximum number of suggestions that should be created for the incorrect word.

Return Value

The array of type WPF.MenuItem for the specified misspelled word.


TXTextControl.WPF.Proofing.TXSpellChecker.HyphenationLanguage Property

Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true. The default value is "(Auto)".

Introduced: 4.0.

Syntax

[C#]
public string HyphenationLanguage{ get; set; }
[Visual Basic]
Public Property HyphenationLanguage() As String
Value | Description
"hyph__.dic" | The corresponding hyphenation list is added to the TXSpell.HyphenationLists collection (e.g. "hyph_en_US.dic" for the US English hyphenation list).
"(Auto)" | That hyphenation list is added to the TXSpell.HyphenationLists collection that equals to the language of the default spell check dictionary. If the default hyphenation lists folder does not contain such a hyphenation list, a list is chosen that corresponds roughly to the dictionary's language (e.g. the default dictionary is "en_GB", but the default hyphenation lists folder only contains a "hyph_en_US.dic" and a "hyph_de_DE.dic" hyphenation list. In this case, the "hyph_en_US.dic" hyphenation list is chosen.). In case that no default spell check dictionary is selected (TXSpell.Language is set to "(none)"), a hyphenation list is chosen that equals or roughly equals to the language of the application environment.
"(none)" | No hyphenation list is set.

Remarks

The property is reset to "(none)", if there is no corresponding hyphenation list in the default hyphenation lists folder that corresponds to the language of the default dictionary's language or the language of the application environment.


TXTextControl.WPF.Proofing.TXSpellChecker.HyphenationLists Property

Gets a collection of all added hyphenation dictionaries. The property's value is an object of type HyphenationListCollection.

Introduced: 4.0.

Syntax

[C#]
public Proofing.HyphenationListCollection HyphenationLists{ get; }
[Visual Basic]
Public ReadOnly Property HyphenationLists() As Proofing.HyphenationListCollection

Limitations

Read only.


TXTextControl.WPF.Proofing.TXSpellChecker.IgnoreCase Property

Gets or sets a value of type IgnoreCaseSettings determining if and how the case of a word is ignored while spell checking. The default value is AllUpper | WordBeginUpper.

Syntax

[C#]
public Proofing.TXSpell.IgnoreCaseSettings IgnoreCase { get; set; }
[Visual Basic]
Public Property IgnoreCase() As Proofing.TXSpell.IgnoreCaseSettings

Remarks

The IgnoreCaseSettings enumeration values Always, Never, WordBegin and WordBeginUpper must not be combined among one another, but can be combined with AllLower and/or AllUpper.

For all other combinations an exception is thrown.


TXTextControl.WPF.Proofing.TXSpellChecker.IgnoreWord Property

Gets or sets a value of type IgnoreWordSettings determining when a word should not be spell checked. The default value is InUpperCase | IsEmail | IsURL | WithNumbers.

Syntax

[C#]
public Proofing.TXSpell.IgnoreWordSettings IgnoreWord { get; set; }
[Visual Basic]
Public Property IgnoreWord() As Proofing.TXSpell.IgnoreWordSettings

Remarks

All values of the IgnoreWordSettings enumeration (apart from IgnoreWordSettings.Never) can be combined. For combinations with IgnoreWordSettings.Never an exception is thrown.


TXTextControl.WPF.Proofing.TXSpellChecker.IncorrectWordChanging Event

Occurs when an object of type IncorrectWord is changing by spell check context menu or spell check dialog operations. The IncorrectWordChangingHandler receives an argument of type IncorrectWordChangingEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event WPF.Proofing.IncorrectWordChangingHandler IncorrectWordChanging;
[Visual Basic]
Public Event IncorrectWordChanging As WPF.Proofing.IncorrectWordChangingHandler

Remarks

This event does not occur on changing objects of type TXTextControl.MisspelledWord. Those operations are handled by the MisspelledWordChanging event.


TXTextControl.WPF.Proofing.TXSpellChecker.IncorrectWords Property

Gets a collection of all incorrect words that were detected by the last call of the TXSpellChecker.Check method. The property's value is an object of type IncorrectWordCollection.

Syntax

[C#]
public Proofing.IncorrectWordCollection IncorrectWords{ get; }
[Visual Basic]
Public ReadOnly Property IncorrectWords() As Proofing.IncorrectWordCollection

Limitations

Read only.


TXTextControl.WPF.Proofing.TXSpellChecker.Language Property

Gets or sets the name of a dictionary that is located at the default dictionary folder. Using the Language property, the Dictionary.IsSelectedAsDefault property of the chosen dictionary is set to true. The default value is "(Auto)".

Syntax

[C#]
public string Language{ get; set; }
[Visual Basic]
Public Property Language() As String
Value | Description
"__.dic" | The corresponding OpenOfficeDictionary is added to the TXSpellChecker.Dictionaries collection (e.g. "en_US.dic" for the US english dictionary).
"__.txd" | The corresponding UserDictionary is added to the TXSpellChecker.Dictionaries collection (e.g. "MyUserDictionary.txd" for an user dictionary that is located in the default dictionary folder).
"(Auto)" | That Dictionary is added to the TXSpellChecker.Dictionaries collection that equals the language of the application environment. If the default dictionary folder does not contain such a dictionary, a dictionary is chosen that corresponds roughly to the environment language (e.g. the application environment is "en_GB", but the default dictionary folder only contains an "en_US" and a "de_DE" dictionary. In this case, the "en_US" dictionary is chosen.). In all other cases (e.g. a German environment, but no German dictionary available) the "en_US" dictionary or (if no "en_US" dictionary available) the first dictionary in the default dictionary folder is loaded. The TXSpellChecker.Language Property is set to "(none)", if the default dictionary folder does not contain any dictionaries.
"(none)" | No dictionary is set.

Remarks

The property is reset to "(Auto)", if there is no corresponding dictionary in the default dictionary folder and to "(none)", if the directory contains no dictionary.

<< TXTextControl.WPF.Proofing.TXSpellChecker.IncorrectWords Property | >> TXTextControl.WPF.Proofing.TXSpellChecker.LanguageRecognitionDirectoryPath Property


TXTextControl.WPF.Proofing.TXSpellChecker.LanguageRecognitionDirectoryPath Property

Gets or sets the path to the language recognition folder that provides the languageRecognition.resources file which is required to detect language scopes in a text. The default value is "(Auto)" that determines the LanguageRecognition directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string LanguageRecognitionDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property LanguageRecognitionDirectoryPath() As String


TXTextControl.WPF.Proofing.TXSpellChecker.LanguageScopes Property

Gets a collection of all detected language scopes. The property's value is an object of type LanguageScopeCollection.

Introduced: 5.0.

Syntax

[C#]
public Proofing.LanguageScopeCollection LanguageScopes{ get; }
[Visual Basic]
Public ReadOnly Property LanguageScopes() As Proofing.LanguageScopeCollection

Limitations

Read only.

<< TXTextControl.WPF.Proofing.TXSpellChecker.LanguageRecognitionDirectoryPath Property | >> TXTextControl.WPF.Proofing.TXSpellChecker.MenuItemClicked Event


TXTextControl.WPF.Proofing.TXSpellChecker.MenuItemClicked Event

Occurs when a MenuItem is clicked. The MenuItemClickedHandler receives an argument of type MenuItemClickedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event WPF.Proofing.MenuItemClickedHandler MenuItemClicked;
[Visual Basic]
Public Event MenuItemClicked As WPF.Proofing.MenuItemClickedHandler


TXTextControl.WPF.Proofing.TXSpellChecker.MisspelledWordChanging Event

Occurs when an object of type TXTextControl.MisspelledWord is changing by spell check context menu or spell check dialog operations. The MisspelledWordChangingHandler receives an argument of type MisspelledWordChangingEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event WPF.Proofing.MisspelledWordChangingHandler MisspelledWordChanging;
[Visual Basic]
Public Event MisspelledWordChanging As WPF.Proofing.MisspelledWordChangingHandler

Remarks

This event does not occur either on changing objects of type IncorrectWord or changing TXTextControl.MisspelledWord objects by using the TXTextControl.TextControl's built-in spell check context menu or spell check dialog. Changing operations on incorrect words are handled by the IncorrectWordChanging event.


TXTextControl.WPF.Proofing.TXSpellChecker.OptionsDialogOpening Event

Occurs when the built-in options dialog is invoked by the TXSpellChecker.OptionsDialog method or clicking the Options... button of the built-in SpellCheckDialog. The OptionsDialogOpeningHandler receives an argument of type OptionsDialogOpeningEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event WPF.Proofing.OptionsDialogOpeningHandler OptionsDialogOpening;
[Visual Basic]
Public Event OptionsDialogOpening As WPF.Proofing.OptionsDialogOpeningHandler


TXTextControl.WPF.Proofing.TXSpellChecker.OptionsDialog Method

Invokes the built-in dialog box to define spell check, create suggestions and hyphenation and create synonyms settings..

OptionsDialog()

Invokes the built-in dialog box that shows all tabs.

[C#]
public void OptionsDialog();
[Visual Basic]
Public Sub OptionsDialog()

OptionsDialog(Int32[])

Invokes the built-in dialog box that shows those tabs that are related to the specified indices.

[C#]
public void OptionsDialog(int[] activeTabs);
[Visual Basic]
Public Sub OptionsDialog(activeTabs As Integer())
Parameter | Description
activeTabs | Specifies the indices of the tabs, zero-based, which are displayed when the tabbed dialog box is opened. Index 0 stands for the spell checking options tab such as case sensitivity and ignoring words. The tab represented by index 1 displays all loaded dictionaries. Tab 2 provides hyphenation options. Tab 3 shows an overview of all loaded Thesaurus files.

OptionsDialog(ShowDialogSettings)

Invokes the built-in dialog box with a ShowDialogSettings instance that shows all tabs.

[C#]
public void OptionsDialog(Proofing.WPF.ShowDialogSettings showDialogSettings);
[Visual Basic]
Public Sub OptionsDialog(showDialogSettings as Proofing.WPF.ShowDialogSettings)
Parameter | Description
showDialogSettings | Sets an instance of the ShowDialogSettings class to determine the dialog's start position and owner.

OptionsDialog(ShowDialogSettings, Int32[])

Invokes the built-in dialog box with a ShowDialogSettings instance that shows those tabs that are related to the specified indices.

[C#]
public void OptionsDialog(Proofing.WPF.ShowDialogSettings showDialogSettings, int[] activeTabs);
[Visual Basic]
Public Sub OptionsDialog(showDialogSettings as Proofing.WPF.ShowDialogSettings, activeTabs As Integer())
Parameter | Description
showDialogSettings | Sets an instance of the ShowDialogSettings class to determine the dialog's start position and owner.
activeTabs | Specifies the indices of the tabs, zero-based, which are displayed when the tabbed dialog box is opened. Index 0 stands for the spell checking options tab such as case sensitivity and ignoring words. The tab represented by index 1 displays all loaded dictionaries. Tab 2 provides hyphenation options. Tab 3 shows an overview of all loaded Thesaurus files.

Remarks

The number of active tabs for the options dialog must be at least one. Otherwise, an ArgumentException is thrown.


TXTextControl.WPF.Proofing.TXSpellChecker.SpellCheckDialog Property

Gets an object of type SpellCheckDialog that is used to modify and show the built-in SpellCheckDialog.

Introduced: 3.0.

Syntax

[C#]
public WPF.Proofing.SpellCheckDialog SpellCheckDialog{ get; }
[Visual Basic]
Public ReadOnly Property SpellCheckDialog() As WPF.Proofing.SpellCheckDialog

Limitations

Read only.


TXTextControl.WPF.Proofing.TXSpellChecker.SpellCheckDialogClosing Event

Occurs when the built-in spell check dialog is closing. The SpellCheckDialogClosingHandler receives an argument of type SpellCheckDialogClosingEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event WPF.Proofing.SpellCheckDialogClosingHandler SpellCheckDialogClosing;
[Visual Basic]
Public Event SpellCheckDialogClosing As WPF.Proofing.SpellCheckDialogClosingHandler


TXTextControl.WPF.Proofing.TXSpellChecker.SpellCheckDialogOpening Event

Occurs when the built-in spell check dialog is invoked using the SpellCheckDialog.Show method. The SpellCheckDialogOpeningHandler receives an argument of type SpellCheckDialogOpeningEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event PF.Proofing.SpellCheckDialogOpeningHandler SpellCheckDialogOpening;
[Visual Basic]
Public Event SpellCheckDialogOpening As PF.Proofing.SpellCheckDialogOpeningHandler

<< TXTextControl.WPF.Proofing.TXSpellChecker.SpellCheckDialogClosing Event | >> TXTextControl.WPF.Proofing.TXSpellChecker.SpellingCorrectionUIProvider Property


TXTextControl.WPF.Proofing.TXSpellChecker.SpellingCorrectionUIProvider Property

Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.

Introduced: 6.0.

Syntax

[C#]
public Proofing.SpellingCorrectionUIProvider SpellingCorrectionUIProvider{ get; }
[Visual Basic]
Public ReadOnly Property SpellingCorrectionUIProvider() As Proofing.SpellingCorrectionUIProvider

Limitations

Read only.


TXTextControl.WPF.Proofing.TXSpellChecker.Suggestions Property

Gets a collection of suggestions that were created by the last call of the TXSpellChecker.CreateSuggestions method. The property's value is an object of type SuggestionCollection.

Syntax

[C#]
public Proofing.SuggestionCollection Suggestions{ get; }
[Visual Basic]
Public ReadOnly Property Suggestions() As Proofing.SuggestionCollection

Limitations

Read only.

<< TXTextControl.WPF.Proofing.TXSpellChecker.SpellingCorrectionUIProvider Property | >> TXTextControl.WPF.Proofing.TXSpellChecker.SynonymLists Property


TXTextControl.WPF.Proofing.TXSpellChecker.SynonymLists Property

Gets a collection of all added synonym lists. The property's value is an object of type SynonymListCollection.

Introduced: 7.0.

Syntax

[C#]
public Proofing.SynonymListCollection SynonymLists{ get; }
[Visual Basic]
Public ReadOnly Property SynonymLists() As Proofing.SynonymListCollection

Limitations

Read only.


TXTextControl.WPF.Proofing.TXSpellChecker.SynonymListsDirectoryPath Property

Gets or sets the path to the default synonym lists folder. The default value is "(Auto)" that determines the SynonymLists directory at the application's root folder or in the \Assembly\ subdirectory in the development machine's TX Spell .NET installation directory.

Introduced: 9.0.

Syntax

[C#]
public string SynonymListsDirectoryPath{ get; }
[Visual Basic]
Public ReadOnly Property SynonymListsDirectoryPath() As String


TXTextControl.WPF.Proofing.TXSpellChecker.SynonymLanguage Property

Gets or sets the name of a synonym list that is located at the default synonym lists folder. When using the SynonymLanguage property, the SynonymList.IsSelectedAsDefault property of the selected synonym list is set to true. The default value is "(Auto)".

Introduced: 7.0.

Syntax

[C#]
public string SynonymLanguage{ get; set; }
[Visual Basic]
Public Property SynonymLanguage() As String
Value | Description
"__.dat" or "__.idx" | The corresponding synonym list is added to the TXSpellChecker.SynonymLists collection (e.g. "th_en_US_v2.dat" for the US English synonym list).
"(Auto)" | That synonym list is added to the TXSpellChecker.SynonymLists collection that equals to the language of the default spell check dictionary. If the default synonym lists folder does not contain such a synonym list, a list is selected that corresponds roughly to the dictionary's language (e.g. the default dictionary is "de_CH", but the default synonym lists folder only contains a "th_en_US_v2.dat" and a "th_de_DE_v2.dat" synonym list. In this case, the "th_de_DE_v2.dat" synonym list is selected.). In case no default spell check dictionary is selected (TXSpellChecker.Language is set to "(none)") or no synonym list was found that resembles the default dictionary's language, a synonym list is selected that equals or roughly equals to the language of the application environment. If no such synonym list is given, the "en_US" synonym list or (if no "en_US" synonym list available) the first synonym list of the default synonym lists folder is selected. The TXSpellChecker.SynonymLanguage Property is set to "(none)", if the default synonym list folder does not contain any synonym lists.
"(none)" | No synonym list is set.

Remarks

The property is reset to "(Auto)", if there is no corresponding synonym list in the default synonym lists folder and to "(none)", if the directory contains no synonym list.

<< TXTextControl.WPF.Proofing.TXSpellChecker.SynonymListsDirectoryPath Property | >> TXTextControl.WPF.Proofing.TXSpellChecker.UserDictionaryWordAdded Event


TXTextControl.WPF.Proofing.TXSpellChecker.UserDictionaryWordAdded Event

Occurs when a word is added to a user dictionary. The UserDictionaryWordAddedHandler receives an argument of type UserDictionaryWordAddedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.UserDictionaryWordAddedHandler UserDictionaryWordAdded;
[Visual Basic]
Public Event UserDictionaryWordAdded As Proofing.UserDictionaryWordAddedHandler


TXTextControl.WPF.Proofing.TXSpellChecker.UserDictionaryWordRemoved Event

Occurs when a word is removed from a user dictionary. The UserDictionaryWordRemovedHandler receives an argument of type UserDictionaryWordRemovedEventArgs containing data related to this event.

Introduced: 3.0.

Syntax

[C#]
public event Proofing.UserDictionaryWordRemovedHandler UserDictionaryWordRemoved;
[Visual Basic]
Public Event UserDictionaryWordRemoved As Proofing.UserDictionaryWordRemovedHandler

<< TXTextControl.WPF.Proofing.TXSpellChecker.UserDictionaryWordAdded Event