Export (0) Print
Expand All

SpellCheck Class

Provides real-time spell-checking functionality to text-editing controls, such as TextBox and RichTextBox.

System::Object
  System.Windows.Controls::SpellCheck

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public ref class SpellCheck sealed

The SpellCheck type exposes the following members.

  NameDescription
Public propertyCustomDictionariesGets the collection of lexicon file locations that are used for custom spell checking.
Public propertyIsEnabledGets or sets a value that determines whether the spelling checker is enabled on this text-editing control, such as TextBox or RichTextBox.
Public propertySpellingReformGets or sets the spelling reform rules that are used by the spelling checker.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodStatic memberGetCustomDictionariesGets the collection of lexicon file locations that are used for custom spelling checkers on a specified text-editing control.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodStatic memberGetIsEnabledReturns a value that indicates whether the spelling checker is enabled on the specified text-editing control.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberSetIsEnabledEnables or disables the spelling checker on the specified text-editing control, such as TextBox or RichTextBox.
Public methodStatic memberSetSpellingReformDetermines the spelling reform rules that are used by the spelling checker.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberCustomDictionariesPropertyIdentifies the CustomDictionaries dependency property.
Public fieldStatic memberIsEnabledPropertyIdentifies the IsEnabled dependency property.
Public fieldStatic memberSpellingReformPropertyIdentifies the SpellingReform dependency property.
Top

To enable the spelling checker, set the SpellCheck::IsEnabled property to true on a text-editing control. When this spelling checker is enabled, misspelled words are underlined by using a red wavy line, as shown in the following illustration. Spelling checker is supported only when WPF provides a default dictionary. In .NET Framework 4, WPF provides dictionaries for English, French, German, and Spanish.

Textbox with spell-checking

To add a custom dictionary, add the location of the lexicon file to the CustomDictionaries collection.

The following example shows how to enable real-time spell checking in a TextBox by using the IsEnabled property of the SpellCheck class.

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <StackPanel>
    <TextBox SpellCheck.IsEnabled="True" Name="myTextBox"></TextBox>
  </StackPanel>

</Page>
No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft