Examples:
A. Displays a message box with specified text.
B. Displays a message box with specified text, caption, and buttons.
string message = "Do you want to close this windows?";
string caption = "Question";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result = MessageBox.Show(message, caption, buttons);
if (result == System.Windows.Forms.DialogResult.Yes)
{
this.Close();
}