I try to create a custom MessageBoxImage for the build in MessageBoxResult
For the custom MessageBoxImage enumeration, I have:
public enum CustomBoxImage
{
Foo = new BitmapImage(new Uri(@"pack://application:,,,/MySoftware;component/Images/foo.png"))
}
and the MessageBoxResult, I have:
MessageBoxResult mrb = MessageBox.Show(
"This will kill you. Are you sure?",
"Kill you",
MessageBoxButton.YesNo, CustomBoxImage.Foo);
But it gives me this error:
Cannot convert from “…CustomBoxImage” to “System.Windows.MessageBoxImage’
How can I insert a customized image enumeration into MessageBoxResult? Or, is it even possible?
You can’t customize the message boxes beyond the given options. If you need a fully customized one, you can use a 3rd party component. You can even make a window look fully like a message box and customize it if you really need to.