开发者

Open button on Messagebox

I have a WinForms application, and when it is finished running, displays a message box with just an OK button.

Is it possible to have an OPEN button on the message box too?

I found this code online:

public static DialogResult Show(string text, string caption, MessageBoxButtons buttons);

But it only gives basic commands, like Yes / No, OK / Cancel, etc. It doesn't show any open button.

开发者_如何学编程I want to OPEN a text file after my program has finished running.

Any help would be greatly appreciated.


No, you can't have any other values in a message box rather than the default, the MessageBoxButtons is predefined enum and you can't add to it. The solution is either use some custom message box, check this, or implement your own MessageBoxForm and add your custom settings to it, check this.


The MessageBox.Show methods exposes serval overloads. You can use one of them as you like. To invoke a MessageBox, simply execute following line:

MessageBox.Show("Hi");

For information you can find on MSDN.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜