Changing the icon of a button in ribbbon

155 views Asked by At

I have a ribbon application that designed based on Extensible Application Markup Language (XAML) in c++. I want to change the icon of one button when i click on it. How can i change the icon? My application is not MFC, I use Windows API.

1

There are 1 answers

0
Daniel Lemke On

You can't change the icon of a button when clicking, at least not in a regular way. The API doesn't support this, I guess for the reason that the UI Ribbon UI concept doesn't intend such a behavior (and you may want to think twice, before breaking an "intended behavior").

Anyway, you could force such a behavior by loading a resource file that refers to the very same XML definition (XML by the way, NOT XAML - we are not in the WPF world here), with the only exception being the source path of the regarding icon referring to something different.

The relevant API call for this is called IUIFramework::LoadUI.