c# WPF vs. Winform

Posted on 2016-08-12
Last Modified: 2016-08-17
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?
Question by:ybt
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 12

Expert Comment

by:Dustin Saunders
ID: 41754024
In WPF you should have TextChanged and LostFocus.

Author Comment

ID: 41754046
In attached file the only list of events I found thereListEvens.jpg
LVL 12

Expert Comment

by:Dustin Saunders
ID: 41754065
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?
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.


Author Comment

ID: 41754069
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?
LVL 12

Expert Comment

by:Dustin Saunders
ID: 41754094
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.

Author Comment

ID: 41756722
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
LVL 70

Accepted Solution

Éric Moreau earned 500 total points
ID: 41756734
you will need to expose the behaviors and properties from WPF to your Windows Forms. I think this article is a bit better:

Author Closing Comment

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

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to repeat the data 4 30
Need help converting bitmap to image in VB.Net 8 45
TFS 2015 Access denied. 1 30
Asp.Net Session Question 2 36
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question