Set check of CMFCRibbonCheckBox

661 views Asked by At

The MFC CMFCRibbonCheckBox class only supports IsChecked().
How do I change check status of ribbon check box in program code? Is there way to set check status like CButton::SetCheck().

1

There are 1 answers

2
Sheng Jiang 蒋晟 On

you can copy code from CMFCRibbonCmdUI::SetCheck. CMFCRibbonBaseElement::m_bIsPressed is a protected member so you need to expose it via a derived class. CMFCRibbonCmdUI has a backdoor to it through class friendship.