我需要在 Windows 窗体和水平模式下动态添加单选按钮。

for (int i = 0; i <= r.Count; i++)
{
RadioButton rdo = new RadioButton();
rdo.Name = "id";
rdo.Text = "Name";
rdo.ForeColor = Color.Red;
rdo.Location = new Point(5, 30 );
this.Controls.Add(rdo);
}
Run Code Online (Sandbox Code Playgroud)