Solved

Trouble with WindowsFormsHost

Posted on 2010-08-15
2
675 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

15 Experts available now in Live!

Get 1:1 Help Now