如何在C#Windows窗体应用程序中激活拼写检查?

use*_*743 10 c# textbox spell-checking winforms

我在Visual Studio 2012中制作了一个C#Windows窗体应用程序.我想添加一个带有拼写检查功能的文本框.你能解释一下它的流程吗?

vic*_*lik 12

如果您使用的是.net4,则可以将References System.XamlWindowsFormsIntegration添加到Winforms项目中.

这允许您在工具箱中找到ElementHost.通过使用ElementHost,您可以在Winfroms项目中使用WPF对象.

System.Windows.Forms.Integration.ElementHost elementHost1 = new System.Windows.Forms.Integration.ElementHost();
System.Windows.Controls.TextBox textBox = new System.Windows.Controls.TextBox();
textBox.SpellCheck.IsEnabled = true;
elementHost1.Child = textBox;
Run Code Online (Sandbox Code Playgroud)


jul*_*gon 7

Windows窗体文本框中没有内置的拼写检查功能.

你可以做的最好的事情可能是在你的表单中嵌入一个WPF文本框.Hans Passant在这篇关于如何实现这一目标的文章中给出了一个非常彻底的答案.