Louis Sayers
Louis Sayers

Reputation: 2219

Wpf hosting windows form - mouse events not getting through

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 :)

Upvotes: 3

Views: 3487

Answers (1)

Alan Mendelevich
Alan Mendelevich

Reputation: 3611

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

Upvotes: 0

Related Questions