Using a WinForms User Control inside WPF

I am having trouble getting MapPoint into WPF:

so I wonder if a WPF expert could simply attempt to use a simple WinForms User Control inside WPF instead.  This would alow me to rule out MapPoint.  It's be great if someone could create a user control with a a checkbox in it, as a WinForms user control.  Then try and get that into a WPF Grid.

Then tel me the steps to do this myself...

newbiewebSr. Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

newbiewebSr. Software EngineerAuthor Commented:
I was looking at that one, but I could not find the source code and decided it was too risky spending time where there is not proof it works.

Can u find the link to download the source?
newbiewebSr. Software EngineerAuthor Commented:
I found a great example from Microsoft:

and there's source code.

I am just confused by this in the XAML file.

     <WindowsFormsHost Name="wfh"
       <mcl:MyControl1 Name="mc"/>

I understand the WindowsFormsHost, but get confused about the definitions for "wfh", which matches its code behind usages.

Also "mcl:" and "mc"

Any comments on these?
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

hi newbieweb:
Attached an example where the control (part of the code) is loaded at runtime
newbiewebSr. Software EngineerAuthor Commented:
I don't understand your last post. (33440537)
Add here the same code but now with namespace reference so you can use it within xaml.
Note that "xmlns:me" refers to the application assembly itself.
newbiewebSr. Software EngineerAuthor Commented:
Is "xmlns:me" for VB?
Hi newbieweb, sorry the attachements were rejected because of the .XAML file extension ???
I will file a complaint, so be sure to rename a few files:
- app.xaml.txt to app.xaml
- MainWindow.xaml.txt to MainWindow.xaml
- Settings.settings.txt to Settings.settings

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
In the example code the


is used to include the components (in this case UserControl1) of the defined assembly (this of the application itself that hosts the UserControl1). Of course you could include others aswell. For instance to include all standard winform controls you could add:


For more info check:
newbiewebSr. Software EngineerAuthor Commented:
Nice program!  That's just what I wanted.  Next I need to try and get a MapPoint control to be the User Control.

If you wanted to have some fun, here's the MapPoint free trial.  When I place the WinForms User Control into WPF it shows up blank?

newbiewebSr. Software EngineerAuthor Commented:
newbiewebSr. Software EngineerAuthor Commented:
Would you know how to have it include the MapPoint control that appears in the ToolBox?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.