码迷,mamicode.com
首页 > Windows程序 > 详细

【WPF】Winform调用WPF窗体注意事项

时间:2016-08-29 17:26:44      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:

 1、需要添加一些引用

技术分享

2、调用处使用如下方法进行调用

Window win= new Window();   
ElementHost.EnableModelessKeyboardInterop(win);
WindowInteropHelper winHelper = new WindowInteropHelper(win);
winHelper.Owner = this.Handle;
win.Show();

 没有ElementHost.EnableModelessKeyboardInterop(wpfwindow)WPF快捷键无效。

WindowInteropHelper类作用是为WPF设置owner。

 

【WPF】Winform调用WPF窗体注意事项

标签:

原文地址:http://www.cnblogs.com/mqxs/p/5818624.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!