0

I'm using Visual Studio 2012 and I work with MFC project. I added a ribbon and I edited it by clicking (in Resource View) on IDR_RIBBON icon. In the visual mode I have added few categories and buttons from Toolbox.

I have also added one button (to compare with visual editor) via code:

CMFCRibbonButton * button = new CMFCRibbonButton();
button->SetImageIndex(1, true);
m_wndRibbonBar.GetCategory(1)->GetPanel(0)->Add(button);

When I compiled and run my application strange thing happened. All buttons and elements that I added by visual editor seems to be disabled (70% grey color), and only the button added from code is enabled.

The illustration is below (the orange buttons are disabled, the second button in first panel is active and was added by above code):

Ribbon

How can I enable the elements added by visual editor?

PolGraphic
  • 3,233
  • 11
  • 51
  • 108
  • 1
    Have you added handlers for your buttons (logic to execute when each of the buttons is clicked)? – Edward Clements Aug 29 '13 at 06:21
  • 1
    Have you added handlers for the button clicks? By default if you have no handler, it's disabled. This is the same way that menu items always worked in MFC. – Roger Rowland Aug 29 '13 at 06:22

0 Answers0