我RadioButtons在网格面板中有四个,但是当我这样做时:
<GroupBox x:Name="radioButtons">
<RadioButton Content="1" Height="16" HorizontalAlignment="Left" Margin="10,45,0,0" Name="status1" VerticalAlignment="Top" />
<RadioButton Content="2" Height="16" HorizontalAlignment="Left" Margin="10,67,0,0" Name="status2" VerticalAlignment="Top" />
<RadioButton Content="3" Height="16" HorizontalAlignment="Left" Margin="10,89,0,0" Name="status3" VerticalAlignment="Top" />
<RadioButton Content="4" Height="16" HorizontalAlignment="Left" Margin="10,111,0,0" Name="status4" VerticalAlignment="Top" />
</GroupBox>
Run Code Online (Sandbox Code Playgroud)
它说:
错误 1 对象“GroupBox”已经有一个子项,无法添加“RadioButton”。“GroupBox”只能接受一个孩子。
最后三个RadioButtons说:
属性“内容”设置了不止一次。
我的GroupBox怎么了?此外,在我的代码中,我想访问RadioButton被检查的(最好是int)。我该怎么做呢?我试着在谷歌上搜索,发现了很多结果,但我一个都看不懂。