前言
在wpf中使用winform控件或者winform的自定义控件
一、添加引用
WindowsFormsIntegration.dll
System.Windows.Forms.dll
提示:这两个引用都是在程序集中可以直接找到的
二、在要使用WinForm控件的WPF窗体的XAML文件中添加如下内容:
代码如下(示例)
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"