Spellcheck in WPF RichTextBox does not provide good suggestions in Windows 11

Bing Li 0 Reputation points
2023-12-21T16:23:02.4266667+00:00

The Spellcheck in WPF's RichTextBox gives out excellent suggestions on Windows 10. See image below from "iwth" to "with".

But the same application yields a long list of largely useless items on Windows 11.

The RickTextBox has the SpellCheck.IsEnabled="True".

Within the RichTextBox there is a FlowDocument and I have its language set up as "en".

<FlowDocument Language="en">

It does not make a difference.

Spellcheck-WIndows10

Spellcheck-WIndows11

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,075 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,854 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
11,885 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bing Li 0 Reputation points
    2023-12-26T16:19:10.1233333+00:00

    Hi Hui,

    Thanks for following up with my question.

    No, my code did not use Nuget, and I did not use any special ContextMenu nor Suggestions.

    I can reproduce the problem with the following standard steps:

    1. Create a C# WPF project using Microsoft Visual Studio Professional 2022 Version 17.7.4, and Microsoft .NET Framework Version 4.8.09037.
    2. Build a project using WPF Application C# Windows template. Targeting .NET Framework 4.8
    3. create a RichTextBox as showing below.
    4. Compile it, when the simple app is run in Windows 10, and after I type in "iwth", the spellcheck correctly suggests "with", only. But if I run the app in Windows 11, the spellcheck spits out a long list of suggestions but not "with". The suggestion list even goes so far as to include "withs". I just cannot figure it out. Why "withs" but not "with".

    Thanks.

    Bing

    <Window x:Class="WpfApp1.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:local="clr-namespace:WpfApp1"
            mc:Ignorable="d"
            Title="MainWindow" Height="450" Width="800">
        <Grid>
            <RichTextBox Name="rtbNote" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SpellCheck.IsEnabled="True" >
                <FlowDocument Language="en">
                    <Paragraph>
                        <Run Text="RichTextBox"/>
                    </Paragraph>
                </FlowDocument>
            </RichTextBox>
        </Grid>
    </Window>
    
    
    0 comments No comments

  2. Bing Li 0 Reputation points
    2024-01-05T15:43:05.85+00:00

    Hi Liu Hui,

    Happy New Year.

    Any update on this issue? The clients are waiting for an answer, even though it is a relatively minor glitch.

    Thanks.

    Bing Li

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.