消息框按钮文本 [英] Messagebox button text

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

问题描述

我环顾四周,看来,一切都可以在编辑一个MessageBox,扎在按钮上的文本(的 WPF / C#)

I've looked around and it appears that everything can be editable in a MessageBox, bar the text on the buttons (WPF/C#)

MessageBox.Show("Generic Message", "Caption", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)

有没有办法改变是,否,取消的文字或者我需要写一个窗口,作为一个消息来做到这一点? (有没有做任何的问题。我只是想知道,如果在WPF的方式)

Is there a way to change the "Yes", "No", "Cancel" text or do I need to write a window to function as a messagebox to accomplish this? (There isn't any problem doing that; I am just wondering if there is a way in WPF.)

推荐答案

可以'吨直接做到这一点。短创建自己的MessageBox,你可以使用 Win32.SetWindowText()描述的此处(转换VB.NET代码的这里)。如果你不希望有处理本地函数,然后自定义消息框将是最好的选择。

You can't do it directly. Short of creating your own MessageBox, you could use Win32.SetWindowText() as described here (convert the VB.NET code here). If you don't want to have to deal with native functions, then a custom MessageBox will be the best option.

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

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