Winform中调用WPF控件

Winform中调用WPF控件

2023年7月19日发(作者:)

Winform中调⽤WPF控件有两种调⽤⽅式,在使⽤之前都将控件“ElementHost”添加到 Form 中:⽅式⼀:直接声明wpf中控件(使⽤ ls)Public Class Form1 Dim txt As x = New x() Private Sub Form1_Load(sender As Object, e As EventArgs) Handles

led = True = txt End SubEnd Class⽅式⼆:⾸先新建⼀个 ”User Control“,之后,如下编辑“”中的内容: 最后,修改”“代码如下:Public Class Form1 Private uc As UserControl1 = New UserControl1() Private Sub Form1_Load(sender As Object, e As EventArgs) Handles = uc End SubEnd Class结果如下所⽰:

发布者:admin,转转请注明出处:http://www.yc00.com/web/1689722575a281134.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信