Avatar of ybt
ybt
 asked on

c# WPF vs. Winform

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?
C#.NET Programming

Avatar of undefined
Last Comment
ybt

8/22/2022 - Mon
Dustin Saunders

In WPF you should have TextChanged and LostFocus.
ybt

ASKER
In attached file the only list of events I found thereListEvens.jpg
Dustin Saunders

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?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ybt

ASKER
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 Saunders

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

ASKER
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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Éric Moreau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ybt

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