GroupBoxes を使用して、ラジオボタンのセットをグループボックス内に配置し、他のセットを別のグループボックス内に配置する必要があります
このようにして、ラジオボタンのすべてのセットが他のセットから分離され、期待どおりに機能します
次のコードは、フォームを手動で作成する例にすぎません。デザイナーを使用すると、InitializeComponent メソッド内にこのコードと同等のコードが作成されます。2 つのラジオボタン セットが異なるコンテナー (グループボックス) の子であることに注意してください。
' A generic form
Dim f as Form = new Form()
f.Size = new Size(300, 500)
' Create a Group box
Dim b1 as GroupBox = new GroupBox()
b1.Text = "Gender"
b1.Location = new Point(0,0)
' Create two radiobutton for Gender
Dim r1 as RadioButton = new RadioButton()
r1.Text = "Male"
r1.Location = new Point(5,15)
Dim r2 As RadioButton = new RadioButton()
r2.Text = "Female"
r2.Location = new Point(5, 40)
' Add the two radiobuttons to the GroupBox control collection
b1.Controls.AddRange(new Control() {r1, r2})
' Repeat for the second set of radiobuttons
Dim b2 as GroupBox = new GroupBox()
b2.Text = "Activity Rate"
b2.Location = new Point(0,100)
Dim r3 As RadioButton = new RadioButton()
r3.Text = "Active"
r3.Location = new Point(5,15)
Dim r4 as RadioButton = new RadioButton()
r4.Text = "Inactive"
r4.Location = new Point(5,40)
b2.Controls.AddRange(new Control() {r3, r4})
' Finally add the GroupBoxes to the Form ControlsCollection
f.Controls.AddRange(new Control() {b1, b2})
f.ShowDialog()