How to show Error & Warning Message Box in .NET/ How to Customize MessageBox

claws picture claws · Jan 21, 2010 · Viewed 330.7k times · Source

Using C# .NET (Winforms).

I want to know how can I show the message boxes with a Ding!! sound & a red colored cross mark in it. This is what I'm talking about:

screenshot

How to do such things for my software, with custom errors and custom warnings?

MessageBox.Show("asdf");

doesn't give me customize.

Answer

Andrew Hare picture Andrew Hare · Jan 21, 2010

Try this:

MessageBox.Show("Some text", "Some title", 
    MessageBoxButtons.OK, MessageBoxIcon.Error);