在不更改键盘语言的情况下为文本框设置拼写检查语言吗? [英] Setting spellcheck language for textbox WITHOUT changing keyboard language possible?

查看:96
本文介绍了在不更改键盘语言的情况下为文本框设置拼写检查语言吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#& .Net 4.0,并希望在不更改键盘布局的情况下为文本框设置differentnet拼写检查语言.

I am using C# & .Net 4.0 and want to set the a differnet spellcheck language for a textbox without changing the keyboard layout.

我在这里阅读了很多精彩的文章后发现,可以更改InputLanguage.CurrentInputLanguage来更改文本框的SpellCheck语言.但这具有副作用,即键盘布局/语言也已更改.但是我始终需要对我的文本框进行EN SpellCheck,而不会导致用户键盘设置崩溃.这种情况有什么办法吗?

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.

您必须知道,我在Winforms项目中使用了WPF TextBox.这是示例代码:

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;

这篇关于在不更改键盘语言的情况下为文本框设置拼写检查语言吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆