日期:2014-05-17 浏览次数:21059 次
private string SearchCheckedRadioButton(Control.ControlCollection controlCllection)
{
foreach (var item in controlCllection)
{
if (item is RadioButton)
{
RadioButton radioButton = item as RadioButton;
if (radioButton.Checked)
{
return radioButton.Text.Trim();
}
}
}
return null;
}
private void button1_Click(object sender, EventArgs e)
{
int num1 = 0;
string value = SearchCheckedRadioButton(groupBox1.Controls);
switch (value)
{
case "0-10":
num1 = new Random().Next(0, 10);
break;
case "0-20":
num1 = new Random().Next(0, 20);
break;
case&nb