?
Solved

Trouble with WindowsFormsHost

Posted on 2010-08-15
2
Medium Priority
?
682 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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

762 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