I host a windows form control in wpf WindowsFormsHost in .net4.5 wpf, like
<Grid MouseDown="Grid_MouseDown" Background="#FFE85050">
<WindowsFormsHost HorizontalAlignment="Left" Height="244"
VerticalAlignment="Top" Width="335"
MouseDown="WindowsFormsHost_MouseDown">
<ctrl:UserControl1 x:Name="aa" MouseClick="aa_MouseClick"/>
</WindowsFormsHost>
</Grid>
the aa_MouseClick fires correctly but WindowsFormsHost_MouseDown and Grid_MouseDown never fires(the windows form control eat the event), how can I fix this problem?
Event handling startegy of
WPFandWinFormsis completely different.MouseDownevent handled in Winforms can't be propagated up to WPF control.WPF uses routed event instead of old event handling of WinForms.Even event handlers differ in signature. What you can do is hook
MouseDownevent onWinForms controland cando your stuff from there.OR
You can try approach mentioned here, its other way round though from WPF to Winforms but can be applied in your situation as well.