#943 – Turning on Spell Checking within a TextBox

You can enable automatic spell checking in a TextBox control by setting the SpellCheck.IsEnabled property to true.

        <TextBox Margin="5" Height="100"
                 TextWrapping="Wrap"
                 AcceptsReturn="True"
                 VerticalScrollBarVisibility="Auto"
                 SpellCheck.IsEnabled="True"/>

When spell-checking is enabled, words that are misspelled are underlined with a red squiggly line.

943-001

 

When the spell-checker flags a spelling error, you can right-click on the red line to see a menu of suggested corrections.

943-002

 

Selecting one of the suggestions will cause the misspelled text to be replaced with the correction.

943-003

Advertisement