In WPF, this code:
<StackPanel>
<RadioButton Content="Option1"
IsChecked="True"
GroupName="Options"
HorizontalAlignment="Center"
Margin="0 40"/>
<RadioButton Content="Option2"
IsChecked="True"
GroupName="Options"
HorizontalAlignment="Center"/>
</StackPanel>
and with this code:
<StackPanel>
<RadioButton Content="Option1"
GroupName="Options"
IsChecked="True"
HorizontalAlignment="Center"
Margin="0 40"/>
<RadioButton Content="Option2"
GroupName="Options"
IsChecked="True"
HorizontalAlignment="Center"/>
</StackPanel>
will get different result. And Why? I just adjust the order of GroupName and IsChecked.
I used the code in WPF with .net6 in VS 2022.
I expect to know why I get the different result.
New contributor
zyw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.