WPF项目如何调用winform项目中的自定义控件
一个WPF项目、一个Winform下的写的usercontrol,想在WPF项目中调用此usercontrol,请问如何引用并且添加到WPF窗体上?
[解决办法]
have a try,http://hi.baidu.com/stuoopluwqbbeod/item/32ec38403da42ee2bcf45167
[解决办法]
Geomam.UserControl1 xx = new Geomam.UserControl1();
System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
host.Child = xx;
this.MStackPanel.Children.Add(host);
[解决办法]
自己可以写一个加载winfrom的用户控件
[解决办法]
1.引用 WindowsFormsIntegration.dll
2.MStackPanel是Grid的Name------------<Grid Name="MStackPanel" />
3.Geomam.UserControl1 xx = new Geomam.UserControl1();这里你用你自己的控件