Spell Checker use in WPF with VB.NET

In this article, We will see how to use spell checker in WPF application.
  • 1828

The Spell Checker functionality is very useful. In this article, We will see how to use spell checker in WPF application. This functionality use for check spelling all type in English.  I have explored the SpellCheck functionality of WPF TextBoxBase object.

We will set SpellCheck.IsEnabled="True" property in the textbox after that automatically derive the Spell Checking functionality.

This code is .xaml:-

<Window x:Class="Window1"



    Title="Window1" Height="300" Width="300">



            <RowDefinition Height="30"></RowDefinition>

            <RowDefinition Height="100"></RowDefinition>                      



            <ColumnDefinition Width="30"></ColumnDefinition>

            <ColumnDefinition Width="75"></ColumnDefinition>

            <ColumnDefinition Width="150"></ColumnDefinition>

            <ColumnDefinition Width="30"></ColumnDefinition>


        <Grid Grid.Row="1" Grid.Column="1">

        <TextBlock x:Name="txtSpellMessage" FontSize="15" Text="Comment:" Margin="0,32,0,0"></TextBlock>


         <Grid Grid.Row="1" Grid.Column="2" Grid.RowSpan="2">

             <TextBox x:Name="txtSpellCheck" FontSize="15" SpellCheck.IsEnabled="True"
AcceptsReturn="True" Width="175" Height="150"></TextBox>




After run the application we will see  the TextBox txtSpellCheck, have SpellChecker enabled. We type wrong spelling in the textbox automatically detect misspelled words and will put an red underline on the word.

We can easily spelling check in this application throw. If we right click on this word then a list of words is shown. We can select the correct word from the list available with us.




More Articles

© 2020 DotNetHeaven. All rights reserved.