Assembly: PresentationFramework (in PresentationFramework.dll)
Thetype exposes the following members.
|Correct||Replaces the spelling error text with the specified correction.|
|Equals(Object)||Determines whether the specified Object is equal to the current Object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|IgnoreAll||Instructs the control to ignore this error and any duplicates for the remainder of the lifetime of the control.|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
By default, when you enable spell checking in an editing control like TextBox or RichTextBox, you get spell-checking choices in the context menu. For example, when users right-click a misspelled word, they get a set of spelling suggestions or the option to Ignore All. However, when you override the default context menu with your own custom context menu, this functionality is lost, and you need to write code to reenable the spell-checking feature in the context menu. The following example shows how to enable this on a TextBox.
The following example shows the Extensible Application Markup Language (XAML) that creates a TextBox with some events that are used to implement the context menu.
<Page x:Class="SDKSample.SpellerCustomContextMenu" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="OnWindowLoaded"> <TextBox Name="myTextBox" TextWrapping="Wrap" SpellCheck.IsEnabled="True" ContextMenuOpening="tb_ContextMenuOpening"> In a custum menu you need to write code to add speler choices because everything in a custom context menu has to be added explicitly. </TextBox> </Page>
The following example shows the code that implements the context menu.
spellingError = myTextBox.GetSpellingError(caretIndex);
spellingError = myRichTextBox.GetSpellingError(myRichTextBox.CaretPosition);
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.