方法 : テキスト編集コントロールでスペル チェックを有効にする

SpellCheck クラスの IsEnabled プロパティを使用して、TextBox でのリアルタイム スペル チェックを有効にする方法を次の例に示します。

使用例

<Page xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="https://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
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;
        }
    }
}

参照

処理手順

方法 : コンテキスト メニューでスペル チェックを使用する

概念

TextBox の概要

RichTextBox の概要