Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 930
  • Last Modified:

SpellChecker problem in RichTextBox in WPF in VS 2008

I am trying to activate the spellchecking of a RichTextBox control but nothing happens.

I have tried (and double checked) the <RichTextBox SpellCheck.IsEnabled="True"/>, but nothing happens.

I have also downloaded 3 different demo projects that all demostrate the use of the new RichTextBox. All project builds and works perfectly, except for the spellchecker function which is totally silent. I have also tried to change the language using the attribute for this (since the OS language is Norwegian), but it does not help. Is the cause for this kind of problem known? Is the problem the OS language settings?

I am using VS 2005 with "VS 2008 addon" which seems to be working since I am able to open VS 2008 projects using the "selector".
0
lieka
Asked:
lieka
  • 3
1 Solution
 
Bob LearnedCommented:
If you have something like this, it should highlight the mispelled words.
    <DockPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Margin='8px'>
        <TextBlock DockPanel.Dock='Top' HorizontalAlignment='Center' FontSize='14pt' FontWeight='Bold'>Windows Presentation Foundation Spell Checker</TextBlock>
        <RichTextBox SpellCheck.IsEnabled='True'>
            <FlowDocument>
                <Paragraph Foreground='#17365D' Background='White' FontSize='12pt' FontFamily='Cambria'>Enter your text here to have it spell-checked. Like soo.</Paragraph>
            </FlowDocument>
        </RichTextBox>
    </DockPanel>

Open in new window

0
 
Bob LearnedCommented:
0
 
liekaAuthor Commented:
Thanks! Finally there was a red line indicating a typo. But - the spellchecker is only concerned about the text added as the paragraph: <Paragraph ......>Enter your text here to have it spell-checked. Like soo.</Paragraph>
Wrongly spelled words ('soo') are indicated, but words added to the controll by editing are not spellchecked. Interestingly, words from the original sentence which are messed up by me inserting text into them are highlighted, but the random/nonsense text inserted into them are not higlighted.
Example: If I change "Enter your text here" to "Enter your te xt xt here" the 'te' and the second 'xt' becomes highlighted, while the inserted/first 'xt' is ignored by the spellchecker.

Should I invoke the spellcheck procedure as a response to any kind of event of the RichTextBox-control?
0
 
Bob LearnedCommented:
It appears that English is supported with the WPF, when typing in the RichTextBox, but I don't know what other languages are supported.

Bob
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now