C#编程的时候老是弹出这个框,如何关闭?

我输入个变量 i ,它就弹出这个框,挺麻烦的,请问如何选择性的关闭它呢?

string message = "要关闭窗口?";
string caption = "提示";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result; // Displays the MessageBox. result = MessageBox.Show(this, message, caption, buttons,
MessageBoxIcon.Question); if (result == DialogResult.No)
{ // Closes the parent form. this.Close(); }
温馨提示:答案为网友推荐,仅供参考
相似回答