I am using C# & .Net 4.0 and want to set the a differnet spellcheck language for a textbox without changing the keyboard layout.
I found out by reading great postings here that it is possible to change InputLanguage.CurrentInputLanguage for changing the SpellCheck language of my textbox. But this has the sideeffect, that the keyboard layout/language was changed too. But I need always an EN SpellCheck for my textbox without crashing the users keyboard settings. Is there any way for this case?
Thanks in Advance for every hint that can help me to solve this case.
I have found out, how to solve it.
You have to know, that I use the WPF TextBox in a Winforms project. Here is a sample code:
System.Windows.Forms.Integration.ElementHost elementHost1 = new System.Windows.Forms.Integration.ElementHost();
System.Windows.Controls.TextBox textBox = new System.Windows.Controls.TextBox();
textBox.Language = System.Windows.Markup.XmlLanguage.GetLanguage("en-GB");
textBox.SpellCheck.IsEnabled = true;
elementHost1.Child = textBox;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With