如何使用WPF显示指定所有者的表单。 [英] How to show form with specified owner using WPF.

查看:74
本文介绍了如何使用WPF显示指定所有者的表单。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c#winform中,我们有以下方法来显示具有指定所有者的模态形式。

In c# winform we have the follwing method to show modal form with specified owner.

Form.ShowDialog( window );



在WPF中我们有任何方法用于调用具有指定所有者的模态形式,因为,只有一种方法可以调用模式形式,任何活动窗口作为其父级。


Where as in WPF do we have any method for calling modal form with specified owner because, there is only one method to call modal form with any active window as its parent.

wpfwindow.ShowDialog();

推荐答案





尝试以下操作,您可以使用窗口的所有者属性指定所有者。

Hi,

try the following, you can specify the owner using Owner property of the window.
wpfwindow.Owner = specifyOwnerWindowHere;
wpfwindow.ShowDialog();


这篇关于如何使用WPF显示指定所有者的表单。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆