日期:2014-05-17 浏览次数:21036 次
for (int i = 10; i > 0; i--) { RadioButton rb = new RadioButton(); rb.Dock = DockStyle.Left; rb.Tag = i.ToString(); rb.Text = "CH" + i.ToString(); rb.Padding = new Padding(0, 0, 5, 0); rb.AutoSize = true; rb.Width = 35; if (i == 1) { rb.Checked = true; } panel2.Controls.Add(rb); }