messageBox用法

 private void button1_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBox.Show("是否保存当前文件?", "gbwu温馨提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
               
          
            if (res == DialogResult.Yes)
            {
                //保存文件
                MessageBox.Show("shi");

            }
            else if (res == DialogResult.No)
            {
                //直接退出
                Application.Exit();
              
            }else
            {
                //停在当前转太
                MessageBox.Show("quxiao");
            }

        }

你可能感兴趣的:(message)