C#怎么怎么弹出一个对话框确认跟取消?

2024-11-30 18:38:57
推荐回答(1个)
回答1:

private void button2_Click(object sender, EventArgs e) { if(MessageBox.Show("确认退出?","确认",MessageBoxButtons.OKCancel,MessageBoxIcon.Question) == DialogResult.OK) { //Application.Exit(); Close(); Dispose(); } }

采纳哦