我想知道是否在button_click事件中執行了一個語音按鈕選擇語句,但我不知道該怎麼做。我想要這樣,但它不起作用。顯示在button_click事件中選擇的單選按鈕
private void butto1_Click (object sender, EventArgs e)
{
if (radioButton1.Checked == true)
{
MessageBox.Show ("radibutton1 selected");
// execute other statement
}
else if (radioButton2.Checked == true)
{
MessageBox.Show ("radibutton2 selected");
// execute other statement
}
}
如果我放在單選CheckChanged事件是工作,但我想在button_Click事件。我發現和研究很多,但我仍然找不到解決方案。
感謝yup它顯示..但是,一旦我把這一行內的if(radioButton1.Checked == true)它不顯示。 –
@NareenNair看到我的編輯 – Sakura
先生很抱歉的回覆,我的互聯網不工作..所以我不得不等待......並打電話給客戶服務,他們重置我的連接,這是我遲到了。我爲此道歉。先生,我試了一下,結果是點擊按鈕,然後是真的,然後是錯誤的。 –