Search code examples
c#.netwinforms

How to show a custom error or warning message box in .NET Winforms?


How can I show message boxes with a "Ding!" sound and a red 'close' button in it? This is what I'm talking about:

screenshot

I'm trying to create some custom errors and warnings, but this:

MessageBox.Show("Ding!");

doesn't seem to give me any customization options.


Solution

  • Try this:

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