use*_*743 10 c# textbox spell-checking winforms
我在Visual Studio 2012中制作了一个C#Windows窗体应用程序.我想添加一个带有拼写检查功能的文本框.你能解释一下它的流程吗?
vic*_*lik 12
如果您使用的是.net4,则可以将References System.Xaml和WindowsFormsIntegration添加到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)