string message = "you did not enter a server name. cancel this operation?";
string caption = "no server name specified";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;
// displays the messagebox.
result = MessageBox.Show(this, message, caption, buttons,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign);
if (result == DialogResult.Yes)
{
//do your action here.
}