MessageBox 加入 Yes / No 的 按鈕
private void button_test_Click(object sender, EventArgs e)
{
if (MessageBox.Show("測試 Yes / No", "Yes / No", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
textBox_test.Text = "Yes";
}
else
{
textBox_test.Text = "No";
}
}
重點就是 MessageBoxButtons.YesNo