本ページは広告が含まれています。気になる広告をクリック頂けますと、サーバ運営費になります(^^
ラジオボタンを配置してトグルボタンにする方法
![](https://techlive.tokyo/wp-content/uploads/2021/03/image-1.png)
ラジオボタンを配置しておいて、後はスタイルを適用するだけで、トグルボタンになります。
![](https://techlive.tokyo/wp-content/uploads/2021/03/image.png)
ラジオボタンを配置すると、Xamlはこのように加えられます
<RadioButton x:Name="radioButton_Copy" Content="RadioButton" HorizontalAlignment="Left" Margin="948,465,0,0" VerticalAlignment="Top" GroupName="RangeMode"/>
Xamlにこれを書き加えるだけです
Style=”{StaticResource {x:Type ToggleButton}}”
全体的にはこんなコードになります。
<RadioButton x:Name="radioButton_Copy" Content="RadioButton" HorizontalAlignment="Left" Margin="948,465,0,0" VerticalAlignment="Top" GroupName="RangeMode" Style="{StaticResource {x:Type ToggleButton}}"/>