tags:

views:

227

answers:

1
+1  Q: 

WPF Spell check

Hi,

I'm playing with the integrated spell check in WPF.

I need to configure it dynamically from code behind, not just in XAML. XAML solution works perfectly (SpellCheck.IsEnabled=true + xml:lang attribute).

However if I try to enable spell check using this code snippet, it is not working:

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); 
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
tb.SpellCheck.IsEnabled = true;

Any ideas?

Thank you very much

+2  A: 
        tb.Language = System.Windows.Markup.XmlLanguage.GetLanguage("en-us");
        tb.SpellCheck.IsEnabled = true;
pb
Thank you! Working.
Dusan Kocurek