Solved

Trouble with WindowsFormsHost

Posted on 2010-08-15
2
679 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
[X]
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
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 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