Search code examples
.nettaskbarmessagebox

MessageBox.Show flavor that shows up on the taskbar


Is there a way to call MessageBox.Show that appears in the taskbar?

It would probably be best to just create a custom form and display it of course, but being a lazy programmer I want to avoid redoing the default Error and Alert notification icons you get with a good old fashioned MessageBox.Show call.


Solution

  • Try using the MessageBoxOptions enum:

    MessageBox.Show("Test", "Test", MessageBoxButtons.OK, MessageBoxIcon.Information,
        MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
    

    Note: There are some multi threading side effect to the usage of this, see the article How To Display A User Interface From A Daemon.