Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   How to use a Checkbox in a ribbon? (http://www.go4expert.com/forums/checkbox-ribbon-t26019/)

EGD Eric 9Jun2011 23:48

How to use a Checkbox in a ribbon?
Hi, I'm trying to figure out how to use a checkbox inside of a ribbon. The checkboxes I added to my ribbon in the editor get unchecked as soon as I check them, so I tried to create an event handler for my checkbox:



void CMainFrame::OnVideoRecording()
        // TODO: Add your command handler code here
        m_bEnableVideo = !m_bEnableVideo;

Then I figure I can have a ON_UPDATE_COMMAND_UI event created for the checkbox, which would set the checkbox to m_bEnableVideo. Unfortunately, I set a breakpoint and OnVideoRecording never gets entered.

Maybe I'm on the wrong track? Maybe there's an easier way of doing checkboxes in ribbons in MFC? Any help would be appreciated, thanks, I've been having trouble finding good documentation on this subject. It seems like MFC has changed since I last used it, or maybe its just ribbons that are different, I dunno.

I set up the project with "MFC standard" for application type, and specified it to "use a ribbon", and I'm not using doc/view architecture.

EGD Eric 10Jun2011 00:01

Re: How to use a Checkbox in a ribbon?
Ah, I see the problem now. I had some leftover handler declared in my CChildView class that was grabbing it.

EGD Eric 10Jun2011 00:23

Re: How to use a Checkbox in a ribbon?
BTW, does anyone know a better way of doing it than I'm using?

All times are GMT +5.5. The time now is 13:50.