Solved

Trouble with WindowsFormsHost

Posted on 2010-08-15
2
677 Views
Last Modified: 2013-12-17
I am trying to get a MapPoint control displayed inside a WPF page and the instruction page has left me confused.
http://www.mapforums.com/wpf-mappoint-control-7768.html

I have done everything up to (and including) creating this XAML:
<WindowsFormsHost x:Name="zoneAx" Canvas.Top="60" Canvas.Left="10" Width="780" Height="300">
</WindowsFormsHost>
 
and it compiles.  But I do not understand whether I should put something inside these tags, or if the name "zoneAX" must match the name used for the WinForms User Control.

Also, there is no "Loaded" event, so I have not completed the last 2 steps.


I would just love to see someone string with WPF explain how it all should fit, or even try and do it themselves by using the free MapPoint download.

Trial MapPoint (full version)
http://www.microsoft.com/downloads/details.aspx?FamilyID=afece5c3-b48b-417d-8dae-de9616b16d18&displaylang=en

Hope to hear from you.  I am stuck and the project deadline would force me to not use WPF.

:(

Thanks,
newbieweb
0
Comment
Question by:newbieweb
2 Comments
 
LVL 3

Accepted Solution

by:
bkokx earned 500 total points
ID: 33440618
The WindowsFormsHost  is a container, you do indeed need to add the child component:

e.g.

<WindowsFormsHost x:Name="zoneAx" Canvas.Top="60" Canvas.Left="10" Width="780" Height="300">
     <me:UserControl1 x:Name="wfuc1"></me:UserControl1>
</WindowsFormsHost>

Or by in rumtime:

     zoneAx.Child = new UserControl1();
0
 

Author Closing Comment

by:newbieweb
ID: 33440628
I will give it a try...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

825 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