消息框上的“打开"按钮 [英] Open button on Messagebox

查看:102
本文介绍了消息框上的“打开"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WinForms应用程序,当它完成运行时,显示一个仅带有确定"按钮的消息框.

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);

但是它只提供基本命令,例如Yes / NoOK / Cancel等.它不显示任何打开按钮.

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.

任何帮助将不胜感激.

推荐答案

不,您不能在消息框中输入其他任何值,而不能使用默认值,MessageBoxButtons是预定义的enum,并且您不能添加到它.解决方案是使用一些自定义消息框,选中,或实现您自己的MessageBoxForm并添加您的自定义设置,请检查.

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.

这篇关于消息框上的“打开"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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