如何知道表单是否显示为对话框 [英] How to know if a form is shown as dialog

查看:41
本文介绍了如何知道表单是否显示为对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否已经可以使用某些属性,例如:

Is there is already some property that I could use such as:

if (this.IsDialog)
{
    DialogResult = ...;
}
else
{
    //do something else
}

还是应该在将表单显示为对话框之前创建此类属性我自己并将其设置为 true ?

Or should I create such property myself and set it to true before showing the form as dialog?

推荐答案

您可以检查是否

You can check to see if this.Modal is true.

这篇关于如何知道表单是否显示为对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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