Winform 添加wpf用户控件

1.在Winform项目中添加Wpf控件的引用。可以引用dll文件,也可以引用wpf 用户控件原项目。

2.在Winform窗口中添加ElementHost控件,并给ElementHost控件设置name,elementHost1
3.在Form构造函数中实例化WPF用户控件,并添加到ElementHost控件中。
        public Form1()
        {
            InitializeComponent();
           SingleViewWithROI.SingleViewWithRoi edit = new SingleViewWithROI.SingleViewWithRoi();
            elementHost1.Child = edit;
        }
原文地址:https://www.cnblogs.com/sclu/p/13603200.html