CWnd::CheckRadioButton

Selects (adds a check mark to) a given radio button in a group and clears (removes a check mark from) all other radio buttons in the group.

void CheckRadioButton(
   int nIDFirstButton,
   int nIDLastButton,
   int nIDCheckButton 
);

Parameters

  • nIDFirstButton
    Specifies the integer identifier of the first radio button in the group.

  • nIDLastButton
    Specifies the integer identifier of the last radio button in the group.

  • nIDCheckButton
    Specifies the integer identifier of the radio button to be checked.

Remarks

The CheckRadioButton function sends a BM_SETCHECK message to the specified radio button.

Example

// Of the 4 radio buttons, selects radio button 3.
void CMyDlg::OnMarkRadio() 
{
   CheckRadioButton(IDC_RADIO1, IDC_RADIO4, IDC_RADIO3);   
}

Requirements

Header: afxwin.h

See Also

Reference

CWnd Class

Hierarchy Chart

CWnd::GetCheckedRadioButton

CButton::SetCheck

CheckRadioButton

Concepts

CWnd Members