SpellCheck.SetIsEnabled Method

Enables or disables spellchecking on the specified text editing control (i.e. TextBox or RichTextBox).

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

public static void SetIsEnabled (
	TextBoxBase textBoxBase,
	bool value
public static void SetIsEnabled (
	TextBoxBase textBoxBase, 
	boolean value
public static function SetIsEnabled (
	textBoxBase : TextBoxBase, 
	value : boolean
You cannot use methods in XAML.



The text editing control (i.e. TextBox or RichTextBox) to enable or disable spellchecking on.


Boolean value that specifies whether spellchecking is enabled on the text editing control.

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

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

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


using System;
using System.Windows;
using System.Windows.Controls;

namespace SDKSample
    public partial class SpellCheckExample : Page
        public SpellCheckExample()
            StackPanel myStackPanel = new StackPanel();

            //Create TextBox
            TextBox myTextBox = 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);

            this.Content = myStackPanel;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions