Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
601 views
in Technique[技术] by (71.8m points)

winforms - How to activate spellCheck in C# Windows Form Application?

I am making a C# Windows Form Application in Visual Studio 2012. I want add a textbox with spell checking capabilities. Could you please explain me the process for it ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you are using .net4 you can add the References System.Xaml and WindowsFormsIntegration to your Winforms project.

This allows you to find the ElementHost in you Toolbox. By using the ElementHost you can use WPF objects in your Winfroms project.

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;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...