1
我有一個名爲組合框的winforms應用程序priceClassGroupBox。它裏面我動態地添加單選按鈕,而我給一個名,說收音機1,第二廣播電臺,radio3。獲取組內選定的RadioButton
我有2個問題:
- 我可以自動選擇一個給定的單選按鈕通過它的名不通過每個控制迭代?
- 我可以得到名稱選定的RadioButton,而無需遍歷每個控件?
我有一個名爲組合框的winforms應用程序priceClassGroupBox。它裏面我動態地添加單選按鈕,而我給一個名,說收音機1,第二廣播電臺,radio3。獲取組內選定的RadioButton
我有2個問題:
如
RadioButton rdo = (RadioButton)priceClassGroupBox.Controls.Find("radio1", false);
2。不,你將不得不遍歷並找到所選的單選按鈕