MFC Radio Button笔记

RadioButton分组 :将本组第一个风格加Group;

多分组情况下:

各RadioButton需要设置Tab顺序。某一个RadioButton设置Group属性后,其Tab次序后的与其一个组。遇到另一个设置Group属性的RadioButton,则开始新的组。设置Tab顺序快捷键Ctrl+D(菜单Format->Tab Order)。

 

 

 

 

 int GetCheckedRadioButton(int nIDFirstButton, int nIDLastButton);

参数为起始RadioButton和结束RadioButton的ID值;并且必须属于同一个Group,返回的是当前选中的RadioButton的ID值;

 

将CButton与RadioButton绑定:

CButton mRadioButton;

mRadioButton = (CButton *)this->GetDlgItem(IDC_RADIO1);

 

mRadioButton->GetCheck()返回1则此RadioButton被选中,返回0没选中。

 

 

 

一个Radio Button设置Group后,在对话框资源上右键Radio Button,选中Control variable选项

可以为整个Group添加CButton对象,其他Group成员不能再添加CButton对象

不选中Control variable选项时,可以为Group属性Buttton以及其他Group成员添加int,float,char等数据类型变量

非Group属性Button可以为选择要加入的Group:Control ID列表中选择已设

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值