Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Messagebox button text

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)

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

like image 985
Oli Avatar asked Jan 06 '12 16:01

Oli


1 Answers

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.

like image 108
keyboardP Avatar answered Oct 06 '22 19:10

keyboardP