Solve the mouse click control problem of vs mfc about a single radio button

BOOL rationstatus =1;  //全局变量
	UpdateData(TRUE);


	//newstatus = ((CButton *)GetDlgItem(IDC_RADIO1_HEX))->GetCheck();
	if ((rationstatus ==1))
	{
    
    
		((CButton *)GetDlgItem(IDC_RADIO1_HEX))->SetCheck((true));//选上
		rationstatus = 0;
	}
	else
	{
    
    
		((CButton *)GetDlgItem(IDC_RADIO1_HEX))->SetCheck((false));//选上
		rationstatus = 1;
	}

	UpdateData(FALSE);

In this way, you can click the mouse to open it, and then click it to close it.

Guess you like

Origin blog.csdn.net/weixin_43673603/article/details/129589814