Reader Level:

Spell Checker in WPF

By Rahul Saxena on Apr 27, 2010
In this article I am going to show how we can check our word spelling in WPF.

In this article, I am going to show how we can check spelling of our content in wpf application. For doing this WPF have SpellCheck feature. SpellCheck is added to TextBoxBase object mean if we set SpellCheck.IsEnabled="True" property of our text box then this textbox automatically derive the Spell Checking functionality

This is xaml code

<Window x:Class="SpellCheckerInWPF.MainWindow"



        Title="Spell Check in WPF" Height="350" Width="525">



            <RowDefinition Height="20"></RowDefinition>

            <RowDefinition Height="20"></RowDefinition>

            <RowDefinition Height="20"></RowDefinition>

            <RowDefinition Height="Auto"></RowDefinition>

            <RowDefinition Height="20"></RowDefinition>



            <ColumnDefinition Width="20"></ColumnDefinition>

            <ColumnDefinition Width="100"></ColumnDefinition>

            <ColumnDefinition Width="200"></ColumnDefinition>

            <ColumnDefinition Width="Auto"></ColumnDefinition>

            <ColumnDefinition Width="20"></ColumnDefinition>


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

            <TextBlock x:Name="txtBlckSpellMessage" Text="Comment:"></TextBlock>


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

            <TextBox x:Name="txtSpellCheck" SpellCheck.IsEnabled="True" AcceptsReturn="True" Width="200"></TextBox>




When we run the application and if we type wrong spelling then the text will have red underline indicating that it is wrong spelling. 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. Working of spell checker is shown in the below figure.


Figure 1.

Rahul Saxena
Rahul Saxena

Rahul K Saxena is working as a Technical Analyst in Noida, India. He is Masters in Computers Application. Here in the IT industry for more than 6+ years and his main technical skills include SharePoint 2010, MOSS 2007, ... Read more



Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
Infragistics jQuery Controls

Trending up