消息框关闭按钮 [英] message box close button
本文介绍了消息框关闭按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Dissecting the MessageBox[^]
Hello
In the above link it is given how to disable close button by passing the form as parameter..
How to pass message box as the parameter??
推荐答案
.NET
的标准MessageBox
类通过Show
静态方法显示了MessageBox. Show静态方法generates the MessageBox
在内部使用传递给它的各种参数并返回DialogResult
枚举成员.
用户无法使用MessageBox
的实际实例来操作MessageBox的内容和功能,例如禁用关闭按钮.
因此,问题中提到的文章的作者创建了具有多个功能的自定义extended message box
.功能之一是禁用关闭按钮.
作者创建的extended MessageBox
是从Windows.Forms.Form
派生的,可以从上面的文章下载的源代码中给出的类声明中看到,该文章如下所示
The standardMessageBox
class of.NET
shows the MessageBox by theShow
static method. The Show static methodgenerates the MessageBox
internally using the various arguments passed to it and returnsDialogResult
enum member.
The actual instance of theMessageBox
is not available to the user to manipulate the content and features of MessageBox like disabling the close button.
Hence, the author of the Article referred in the question has created a customextended message box
with several features. One of the feature is to disable the close button.
Theextended MessageBox
created by the author is derived from theWindows.Forms.Form
as can be seen from the class declaration given in the source code downloaded from the above article show below
internal class MessageBoxExForm : System.Windows.Forms.Form
由于extended MessageBox
是从Form
类派生的,因此可以将其作为参数传递给private void DisableCloseButton(Form form)
.此方法并不意味着将标准MessageBox
传递给它.
Since, the extended MessageBox
is derived from the Form
class it can be passed to the private void DisableCloseButton(Form form)
as an argument. This method is not meant to pass the standard MessageBox
to it.
我们无法阅读上面的整个链接.告诉我们问题所在,有可能您会得到答案.
We can''t read the entire above link. Tell us the problem, and it is possible that you will get your answer.
这篇关于消息框关闭按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文