该问题来自社区帖: https://bbs.csdn.net/topics/617238226.为符合问答规范, 该问题经过ChatGPT优化
问题: 如何获取动态生成的groupBox中radioButton的值并进行计算? ```csharp int o = Convert.ToInt32(textBox1.Text); for (int u = 0; u < o; u++) { GroupBox groupBox = new GroupBox(); groupBox.Location = new Point(53, 12 + 60 * u); groupBox.Size = new Size(734, 52); groupBox.Text = "专家" + (u+1) + "意见"; string[] radioButtonLabels = { "很低", "低", "较低", "中等", "较高", "高", "很高" }; for (int i = 0; i < 7; i++) { RadioButton radioButton = new RadioButton(); radioButton.Text = radioButtonLabels[i]; radioButton.Location = new Point(19 + 100 * i, 26); radioButton.Size = new Size(95, 16); groupBox.Controls.Add(radioButton); } this.Controls.Add(groupBox); } ``` 以上是您生成任意数量的groupBox且每个groupBox包含7个radioButton的代码。请问如何获取这些radioButton的选中值并进行计算? 相关HTML格式代码如下: ```html
问题: 如何获取动态生成的groupBox中radioButton的值并进行计算? ```csharp int o = Convert.ToInt32(textBox1.Text); for (int u = 0; u < o; u++) { GroupBox groupBox = new GroupBox(); groupBox.Location = new Point(53, 12 + 60 * u); groupBox.Size = new Size(734, 52); groupBox.Text = "专家" + (u+1) + "意见"; string[] radioButtonLabels = { "很低", "低", "较低", "中等", "较高", "高", "很高" }; for (int i = 0; i < 7; i++) { RadioButton radioButton = new RadioButton(); radioButton.Text = radioButtonLabels[i]; radioButton.Location = new Point(19 + 100 * i, 26); radioButton.Size = new Size(95, 16); groupBox.Controls.Add(radioButton); } this.Controls.Add(groupBox); } ``` 以上是您生成任意数量的groupBox且每个groupBox包含7个radioButton的代码。请问如何获取这些radioButton的选中值并进行计算? 相关HTML格式代码如下: ```html
int o = Convert.ToInt32(textBox1.Text);
for (int u = 0; u < o; u++)
{
GroupBox groupBox = new GroupBox();
groupBox.Location = new Point(53, 12 + 60 * u);
groupBox.Size = new Size(734, 52);
groupBox.Text = "专家" + (u+1) + "意见";
string[] radioButtonLabels = { "很低", "低", "较低", "中等", "较高", "高", "很高" };
for (int i = 0; i < 7; i++)
{
RadioButton radioButton = new RadioButton();
radioButton.Text = radioButtonLabels[i];
radioButton.Location = new Point(19 + 100 * i, 26);
radioButton.Size = new Size(95, 16);
groupBox.Controls.Add(radioButton);
}
this.Controls.Add(groupBox);
}
以上是您生成任意数量的groupBox且每个groupBox包含7个radioButton的代码。请问如何获取这些radioButton的选中值并进行计算?
```