我在我的表单页面(WinForms)上使用GroupBox控件.
GroupBox包含五个控件(RadioButtons).
知道怎样才能获得GroupBox Control中控件的名称和状态?
Tim*_*ter 14
您可以使用在GroupBox中Enumerable.OfType查找和转换您RadioButtons:
var radioButtons = groupBox1.Controls.OfType<RadioButton>();
foreach (RadioButton rb in radioButtons)
{
    bool state = rb.Checked;
    string name = rb.Name;
}
| 归档时间: | 
 | 
| 查看次数: | 15072 次 | 
| 最近记录: |