Export (0) Print
Expand All

SpellCheck.IsEnabled Property

Gets or sets a value that determines whether the spelling checker is enabled on this text-editing control, such as TextBox or RichTextBox.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public bool IsEnabled { get; set; }
See Remarks.

Property Value

Type: System.Boolean
true if the spelling checker is enabled on the control; otherwise, false. The default value is false.

Identifier field

IsEnabledProperty

Metadata properties set to true

None

This dependency property also has a specialized write-only attached property usage. The XAML syntax for setting the property is <textBoxBaseClass SpellCheck.IsEnabled="boolValue" .../>, where textBoxBaseClass is an object element for a class that derives from TextBoxBase, and boolValue is either true or false (case insensitive). To set the property as an attached property in code, see the SetIsEnabled method. There is no matching GetIsEnabled accessor. To get the value, get the current SpellCheck object from the TextBoxBase.SpellCheck property, and then get the value of the IsEnabled property from that SpellCheck.

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>



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);

            myStackPanel.Children.Add(myTextBox);
            this.Content = myStackPanel;
        }
    }
}


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.

Community Additions

ADD
Show:
© 2014 Microsoft