Export (0) Print
Expand All

SpellCheck.SetIsEnabled Method

Enables or disables the spelling checker on the specified text-editing control, such as TextBox or RichTextBox.

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

'Declaration
Public Shared Sub SetIsEnabled ( _
	textBoxBase As TextBoxBase, _
	value As Boolean _
)

Parameters

textBoxBase
Type: System.Windows.Controls.Primitives.TextBoxBase

The text-editing control on which to enable or disable the spelling checker. Example controls include TextBox and RichTextBox.

value
Type: System.Boolean

A Boolean value that specifies whether the spelling checker is enabled on the text-editing control.

This method enables an attached property usage for the IsEnabled property in XAML. The following example shows the XAML usage.

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>

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)

			myStackPanel.Children.Add(myTextBox)
			Me.Content = myStackPanel
		End Sub
	End Class
End Namespace

.NET Framework

Supported in: 4.5.2, 4.5.1, 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.

Show:
© 2014 Microsoft