什么是展()的ShowDialog()和Application.Run()函数之间的区别? [英] What's the difference between Show(), ShowDialog() and Application.Run() functions?

查看:215
本文介绍了什么是展()的ShowDialog()和Application.Run()函数之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么新展()的ShowDialog()和Application.Run()函数之间的区别?
(的WinForms)我看到:

What's the difference between new Show(), ShowDialog() and Application.Run() functions? In main (winforms) I saw :

Application.Run(new Form1());



然后,为Form1,我也看到了 Form1.Show()与描述:显示控制权交给用户。
对于ShowDialog的,故称显示窗体作为模式对话框。

Then, for Form1, I also saw Form1.Show() with description: "Shows the control to the user." For ShowDialog, it said "Shows the form as a modal dialog box".

这是什么意思?

每个它们的用途是什么,哪些是最常见?

What are each of their uses and which is most common?

推荐答案

显示功能显示在非模态窗体的窗体的。这意味着,你可以点击父窗体上。

The Show function shows the form in a non modal form. This means that you can click on the parent form.

的ShowDialog 显示形式的模态,这意味着你的不能转到父窗体

ShowDialog shows the form modally, meaning you cannot go to the parent form

Application.Run()运行主父窗体,并使得形成的主要形式。 Application.Run()通常在

Application.Run() runs the main parent form, and makes that form the main form. Application.Run() is usually found in main.

这篇关于什么是展()的ShowDialog()和Application.Run()函数之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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