12六月/070
Radio Button研究
當兩個以上的Radio Button,裝在同一個容器(container)中,只有一個Radio Button會在Checked狀態
測試案例:
- 一個FlowLayoutPanel裡面裝著兩個RadioButton
- button1的index較前面,所以一開始預設就會引發CheckedChanged事件,並且為Checked=true
- 利用程式碼先後設定RadioButton為Checked = true
- 設定button1時,因為已經是True所以不變,也沒有引發事件
- 設定button2時
- 先引發button1的CheckedChanged事件,Checked設為False
- 在引發button2的CheckedChanged事件,Checked設為True