所以我有一个包含5 RadioGroup的RadioButtons。我想骑自行车通过按钮,并执行一个行动,每个无线电按钮在小组(与标签的按钮。
阅读单个按钮的标签或在组中获取所选按钮(使用indexOfChild)没有问题。但出于某种原因,我不能做一个循环,循环通过这个无线电组中的所有按钮来执行有关按钮标签的操作。
提前感谢!我希望我的问题有意义。
编辑:在Visual中,我可以做一些类似的事情,但是使用listview而不是radiogroup:
foreach (var item in ListView.Items.Cast<ListViewItem>())
{
stuff
}发布于 2014-07-16 19:13:54
您可以使用以下代码:
for (int i = 0; i < radiogroup.getChildCount(); i++) {
RadioButton child = (RadioButton) radioGroup.getChildAt(i);
// use the button above to do what you want
}https://stackoverflow.com/questions/24767585
复制相似问题