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列表中选择已设