error message box in c# code example

Example 1: c# error messagebox

MessageBox.Show("your message",
    "window title", 
    MessageBoxButtons.OK, 
    MessageBoxIcon.Warning // for Warning  
    //MessageBoxIcon.Error // for Error 
    //MessageBoxIcon.Information  // for Information
    //MessageBoxIcon.Question // for Question
   );

Example 2: messagebox.show c# error

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

Example 3: how to do a messagebox in c#

MessageBox.Show("Content", "Title", MessageBoxIcon.Error)