参考
ms-help://MS.VSCC/MS.MSDNVS.2052/cpguide/html/cpconmsgboxsample.htm

解决方案 »

  1.   

    MessageBox.Show("Hello World!","MsgBox Example");
      

  2.   

    MessageBox.Show没有返回值啊??
    我是想根据返回值判断,然后执行不同的操作
      

  3.   

    private void validateUserEntry2()
       {      // Checks the value of the text.      if(serverName.Text.Length == 0)
          {         // Initializes the variables to pass to the MessageBox.Show method.         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)
             {            // Closes the parent form.            this.Close();         }      }   }