1.CheckBox与RadioButton公共要素


(1)IsChecked为属性,Check为事件

(2)为Content添加图片

wpf学习笔记---Button<CheckBox Name="cb6" Checked="HandleChange1"><Image Source="data\flower.jpg" Height="30" Width="30"/>
wpf学习笔记---Button
</CheckBox>

2.RadioButton分组

(1)一起放容器中

wpf学习笔记---Button<StackPanel>      
wpf学习笔记---Button    
<RadioButton Name="rb1">Yes</RadioButton>
wpf学习笔记---Button    
<RadioButton Name="rb2">No</RadioButton>
wpf学习笔记---Button    
<RadioButton Name="rb3">No opinion</RadioButton>
wpf学习笔记---Button
</StackPanel>

(2)定义GroupName属性,命名组名称

wpf学习笔记---Button    <RadioButton GroupName="colorgrp">Red</RadioButton>
wpf学习笔记---Button    
<RadioButton GroupName="colorgrp">Blue</RadioButton>
wpf学习笔记---Button    
<RadioButton GroupName="numgrp">1</RadioButton>
wpf学习笔记---Button    
<RadioButton GroupName="numgrp">2</RadioButton>

3.RepeatButton可以让你按下按钮不动重复执行事件

结束

相关文章: