【发布时间】:2016-03-19 10:11:39
【问题描述】:
我有这个创建单选按钮的代码,当我点击一个按钮时,当单选按钮检查 If Else 语句时,有人可以告诉我分别选择每个按钮的代码吗?如何使每个单选按钮的文本不同?
private void createButtons()
{
flowLayoutPanel1.Controls.Clear();
for(int i = 0;i <10;i++)
{
RadioButton b = new RadioButton();
b.Name = i.ToString();
b.Text = "radiobutton" + i.ToString();
b.AutoSize = true;
flowLayoutPanel1.Controls.Add(b);
}
}
【问题讨论】:
标签: c# winforms dynamic radio-button