首页 > 其他 > 详细

RadioButton

时间:2017-12-30 23:23:30      阅读:225      评论:0      收藏:0      [点我收藏+]

同属一个GroupName则互斥,只能选择一个

<StackPanel Orientation="Vertical">
    <Label Content="Group1:水果"></Label>
    <RadioButton GroupName="Group1" Content="苹果"></RadioButton>
    <RadioButton GroupName="Group1" Content="荔枝"></RadioButton>
    <RadioButton GroupName="Group1" Content="西瓜"></RadioButton>
    <RadioButton GroupName="Group1" Content="香蕉"></RadioButton>
    <Label Content="Group2:科目"></Label>
    <RadioButton GroupName="Group2" Content="语文"></RadioButton>
    <RadioButton GroupName="Group2" Content="数学"></RadioButton>
    <RadioButton GroupName="Group2" Content="英语"></RadioButton>
    <RadioButton GroupName="Group2" Content="物理"></RadioButton>
</StackPanel>

上面的示例中,可以选择水果、科目下各一个选项,所以水果和科目不互斥,水果之间互斥,科目之间互斥

 
技术分享图片
 

 

示例代码

https://github.com/zLulus/NotePractice/tree/dev3/WPF/WpfDemo/RadioButton

RadioButton

原文:https://www.cnblogs.com/Lulus/p/8151410.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!