3. グループ化する
RadioButtonコントロールはグループ内で1つだけ選択状態にすることができます。
複数のグループを作りたい場合には、GroupNameプロパティを使用してグループ名を付けます。
下記は、FruitsとVegetableという2つのグループを作成する例です。

<Border CornerRadius="5">
<StackPanel>
<RadioButton Content="リンゴ" Name="RadioButton1"
GroupName="Fruits" />
<RadioButton Content="ミカン" Name="RadioButton2"
GroupName="Fruits" />
<RadioButton Content="バナナ" Name="RadioButton3"
GroupName="Fruits" />
</StackPanel>
</Border>
<Border CornerRadius="5">
<StackPanel>
<RadioButton Content="トマト" Name="RadioButton4"
GroupName="Vegetable" />
<RadioButton Content="キュウリ" Name="RadioButton5"
GroupName="Vegetable" />
<RadioButton Content="カボチャ" Name="RadioButton6"
GroupName="Vegetable" />
</StackPanel>
</Border>
'Fruitsグループ RadioButton1.GroupName = "Fruits" RadioButton2.GroupName = "Fruits" RadioButton3.GroupName = "Fruits" 'Vegetableグループ RadioButton4.GroupName = "Vegetable" RadioButton5.GroupName = "Vegetable" RadioButton6.GroupName = "Vegetable"
// Fruitsグループ radioButton1.GroupName = "Fruits"; radioButton2.GroupName = "Fruits"; radioButton3.GroupName = "Fruits"; // Vegetableグループ radioButton4.GroupName = "Vegetable"; radioButton5.GroupName = "Vegetable"; radioButton6.GroupName = "Vegetable";
複数のRadioButtonコントロールをグループ化するにはGroupNameプロパティを使用する。
4. チェックマークを右側に配置する
チェックマークを右側に配置するにはFlowDirectionプロパティにRightToLeftを設定します。下記はチェックマークを右側に配置する例です。

<RadioButton Content="リンゴ" Name="RadioButton1"
FlowDirection="RightToLeft" />
<RadioButton Content="ミカン" Name="RadioButton2"
FlowDirection="RightToLeft" />
<RadioButton Content="バナナ" Name="RadioButton3"
FlowDirection="RightToLeft" />
'チェックマークを右側に配置する RadioButton1.FlowDirection = Windows.FlowDirection.RightToLeft RadioButton2.FlowDirection = Windows.FlowDirection.RightToLeft RadioButton3.FlowDirection = Windows.FlowDirection.RightToLeft
// チェックマークを右側に配置する radioButton1.FlowDirection = FlowDirection.RightToLeft; radioButton2.FlowDirection = FlowDirection.RightToLeft; radioButton3.FlowDirection = FlowDirection.RightToLeft;
チェックマークをコンテントの右側に配置するには、FlowDirectionプロパティをRightToLeftに設定する。
