How to: Enable Spell Checking in a Text Editing Control


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=""

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


Imports System
Imports System.Windows
Imports System.Windows.Controls

Namespace SDKSample
	Partial Public Class SpellCheckExample
		Inherits Page
		Public Sub New()
			Dim myStackPanel As New StackPanel()

			'Create TextBox
			Dim myTextBox As New TextBox()
			myTextBox.Width = 200

			' Enable spellchecking on the TextBox.
			myTextBox.SpellCheck.IsEnabled = True

			' Alternatively, the SetIsEnabled method could be used
			' to enable or disable spell checking like this:
			' SpellCheck.SetIsEnabled(myTextBox, True)

			Me.Content = myStackPanel
		End Sub
	End Class
End Namespace