Would like to know if it is possible to create a MessageBox with custom buttons similar to what one would achieve with showOptionDialog in java?
String[]colors = {"Red", "Green", "Blue"};
int color = JOptionPane.showOptionDialog(null, "Please choose color", "Color please", 0, JOptionPane.INFORMATION_MESSAGE,null, colors, colors[0]);
if(color == 0)
{
JOptionPane.showMessageDialog(null, "Red it is");
}
What would the equivalent for this be in C#?
I’m afraid that the answer is: you can’t.
There is no way to alter the MessageBox as far as I know. You will need to code your own dialog (is not that hard).
Probably the MessageBox class is making a WinApi call at the end and that could be the main reason.