1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > WPF中使用Winform控件

WPF中使用Winform控件

时间:2021-06-03 13:10:06

相关推荐

WPF中使用Winform控件

在项目中遇到使用WPF做上位机,引用Winform控件,特此做一下总结:

1、在设计界面添加:

xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"

2、或者在引用在中引用

3、添加宿主容器

<wfi:WindowsFormsHost><wf:Label x:Name="LogAnalysis"/></wfi:WindowsFormsHost>

4、标签中引用控件,使用方法和Winform类似

引用其他winform类库也如此,将dll文件引入后,声明命名空间,使用对应的控件。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。