1 if (MessageBox.Show("是否要删除数据", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) 2 { 3 MessageBox.Show("yes"); 4 } 5 else 6 { 7 MessageBox.Show("No"); 8 }