WindowsFormsHost的使用注意

一使用
1
引用
2
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
3
由于WindowsFormsHost会指定需要用


<.................>


包裹,且在最外层包裹










WindowsFormsHost鼠标事件响应
1
里面的控件可以响应,若使用Forms的控件注意使用System.Windows.Forms.MouseEventArgs



private void Button_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
int i = 0;
}
2
WindowsFormsHost上无法响应需要使用WinPro
3
使用鼠标事件时需注意顶层是否可以获得鼠标事件

你可能感兴趣的:(wpf学习)