views:

744

answers:

1

Hi,

I've got a WPF app that has a WindowsFormsHost, which hosts a geobase map.

The problem I have is getting the mouse events through to the map. I've added MouseUp event handlers to the map (in code), but this does not work, and I've tried adding the MouseUp event handler on the Grid that contains the WindowsFormsHost, but the events are not picked up by this either.

I'm not sure whether this is a general WPF problem with the way I'm handling events, or a more specific problem that is specific to hosting Windows Forms apps in WPF...

Any pointers would be appreciated :)

A: 

As far as I understand you need to call WindowsFormsHost.EnableWindowsFormsInterop() for events to be forwarded to your winforms code.

Alan Mendelevich
We gave this a go, but had no luck. We've changed our mindset and now are getting an image from the map instead, and importing the image into our app.
Louis Sayers