Search code examples
wpfwpf-controlsrichtextboxculture

Setting Culture / Language in RichTextBox WPF


Hi there is possible to set a default language or set a new one in RichTextBox, i want to set it in "es-PE" for spellchecker propouses

Thanks!


Solution

  • It would seem to be possible setting the xml:lang as in the code below:

       <StackPanel>
        <RichTextBox SpellCheck.IsEnabled="True"/>
        <RichTextBox SpellCheck.IsEnabled="True" xml:lang="es-PE"/>
    </StackPanel>
    

    The first box checks in the default culture and the second in the specified one ("es-PE").

    The documentation also suggests you could add this attribute to a parent control such as a panel and it will be inherited by the child controls.