How to dynamically add Ribbon controls to an application? RRS feed

  • Question

  • Hi,
    I am writing a Win32 application (not MFC). My application needs to dynamically create check boxes in a ribbon group. The number of checkboxes and their labels will not be known until startup. (I experimented with creating a simple application with ribbon controls using markup file and it works).

    Could you please point me to a sample/ suggest me how to do this?

    Thank you
    Saturday, August 22, 2009 2:38 AM


All replies

  • It is not possible to dynamically add controls to a Windows Ribbon framework application. All controls must be declared in the Ribbon markup file that must be compiled into a binary resource file for the Ribbon framework application.

    You might be able to accomplish what you desire by using application modes. For more information, see the 'Reconfiguring the Ribbon with Application Modes' topic at http://msdn.microsoft.com/en-us/library/dd940486(VS.85).aspx.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, September 30, 2009 6:31 PM
  • Thank you for your response. I would like to explore another option: Is it possible to add checkboxs/toggle buttons to a Gallery dynamically? (This seems to be possible, atleast from the latest Microsoft Outlook (Technical Preview): Home tab, Quick Steps gallery. They even allow the user to create a new 'Quick Step' and a button is added to the Quick Step Gallery)

    Could you please point me to some resources which help me with the above scenario?

    Thank you.
    Wednesday, September 30, 2009 7:30 PM
  • Yes, you can dynamically add items to a both Command and item galleries.

    For more information, see the Working with Galleries topic at http://msdn.microsoft.com/en-us/library/dd742868(VS.85).aspx.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, November 18, 2009 11:55 PM