How to activate spellCheck in C# Windows Form Application?

user3218743 picture user3218743 · May 23, 2014 · Viewed 17.8k times · Source

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 ?

Answer

vicklik picture vicklik · Jul 14, 2014

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;