c# WPF vs. Winform

ybt
ybt used Ask the Experts™
on
In C# Winform application, in order to add a spell checker to a textbox, i added usercontrolWPF.textbox but did not find "Leave" and 'TextChanged" events there, what should I do in case if I need it?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dustin SaundersCo-Founder and Chief Architect
Top Expert 2016

Commented:
In WPF you should have TextChanged and LostFocus.
ybt

Author

Commented:
In attached file the only list of events I found thereListEvens.jpg
Dustin SaundersCo-Founder and Chief Architect
Top Expert 2016

Commented:
That looks like the events for an elementHost or a userControl; not the events for a textBox.  How did you add the textBox to the form?
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

ybt

Author

Commented:
The only way I found to add a WPF textbox is to create a usercontrol with textbox inside and place user control in my winform. Is there any other way?
Dustin SaundersCo-Founder and Chief Architect
Top Expert 2016

Commented:
I see, so it's a WPF control in a winform app (not a wpf app).  So when you add the control to your project, you can edit the event fields in the control directly.

It's a bit of a read, but this article goes in depth on controls in hybrid applications.
ybt

Author

Commented:
This article is interesting, but it is still unclear how can I access a textbox event from a window that holds a user control that contains a textbox
Senior .Net Consultant
Top Expert 2016
Commented:
you will need to expose the behaviors and properties from WPF to your Windows Forms. I think this article is a bit better: http://www.developerfusion.com/community/blog-entry/8393574/wpfwinforms-interop-a-highlighted-textbox/
ybt

Author

Commented:
Thank you, this is my first time of use WPF and this article is very simple and helpful.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial