去添加一个引用,System.Windows.Forms 使用using System.Windows.Forms; 就可以使用MessageBox了: MessageBox.Show("You must enter a name.", "Name Entry Error",MessageBoxButtons.YesNo,MessageBoxIcon.Information,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification);
使用using System.Windows.Forms;
就可以使用MessageBox了:
MessageBox.Show("You must enter a name.", "Name Entry Error",MessageBoxButtons.YesNo,MessageBoxIcon.Information,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification);