Solved

c# WPF vs. Winform

Posted on 2016-08-12
8
61 Views
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?
0
Comment
Question by:ybt
  • 4
  • 3
8 Comments
 
LVL 12

Expert Comment

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

Author Comment

by:ybt
ID: 41754046
In attached file the only list of events I found thereListEvens.jpg
0
 
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?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:ybt
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?
0
 
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.
0
 

Author Comment

by:ybt
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
0
 
LVL 70

Accepted Solution

by:
É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: http://www.developerfusion.com/community/blog-entry/8393574/wpfwinforms-interop-a-highlighted-textbox/
0
 

Author Closing Comment

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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Keyboard 2 32
Expression Evaluater 3 24
Sending receiving text messages in vb.net 15 32
insert value of checklistbox checked 4 24
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

816 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now