如何更改MessageBox按钮文本? [英] How to Change MessageBox Button Text?

查看:370
本文介绍了如何更改MessageBox按钮文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DialogResult dr = MessageBox.Show("Welcome To MessageBox.", "Discard Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (dr = DialogResult.Yes)
{
    this.Close();
}
else
{

}


我想更改YesNo Buttons的Text属性.

任何想法,请让我知道.

问候,
Pawan.


I want to change the Text Property of YesNo Buttons.

Any idea, please let me know.

Regards,
Pawan.

推荐答案

您必须创建自己的自定义消息框才能实现此功能.

如果您查看MessageBox类以及与之关联的方法/属性:
MSDN:消息框 [ ^ ]
You have to create your own custom message box to achieve this functionality.

If you look at the MessageBox class, and the methods/properties associated:
MSDN: Message Box[^]
The functionality asked by you is not provided.


MessageBox是系统对话框,不能直接操作.

为了自定义MessageBox,您将必须创建自己的复制功能的Form.然后,您可以根据自己的喜好操纵它.
The MessageBox is a system dialogue and and cannot be manipulated directly.

In order to customise the MessageBox you will have to create your own Form that duplicates the functionality. You can then manipulate it to your heart''s content.


您可以使用技术 [^ ]
重置钩子过程中的按钮文本(SetDlgItemText()):)
You could use the technique[^]
to reset the buttons text (SetDlgItemText()) in the hooks procedure :)


这篇关于如何更改MessageBox按钮文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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