MessageBox OK按钮 [英] MessageBox OK button
本文介绍了MessageBox OK按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到了这个消息框但是如何添加OK按钮?
Hi,
I got this messagebox but how do I add "OK" button?
MessageBox.Show("Hello");
推荐答案
您可以将一个MessageBoxButton作为参数添加到Show方法
,如下所示:
You can add a MessageBoxButton as a parameter to the Show method
like this:
MessageBox.Show("Hello","Alert", MessageBoxButtons.OK);
其中你好是你的文字
提醒是你的标题
和MessageBoxButtons.OK是按钮消息框。
Where "Hello" is your text
"Alert" is your title
and MessageBoxButtons.OK is the button on the messagebox.
DialogResult result1 = MessageBox.Show(some text?,
重要问题,
MessageBoxButtons。 YesNo);
DialogResult result1 = MessageBox.Show("some text?",
"Important Question",
MessageBoxButtons.YesNo);
您好,
请参考以下代码项目链接:
一个简单的ASP.NET服务器控件:消息框&确认框 [ ^ ]
这篇关于MessageBox OK按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文