Update ribbon icon

Add-in Express™ Support Service
That's what is more important than anything else

Update ribbon icon
 
gjvdkamp




Posts: 56
Joined: 2018-08-28
How can I update a ribbon icon at runtime?

I see some threads on changing the icon of a ribbon button at runtime, but none of them seem to work (anymore). What is the recommended way of doing that? (if at all possible).

I tried updating ImageMso directly, calling Invalidate(), doing this:

private void adxSplitLogin_PropertyChanging(object sender, ADXRibbonPropertyChangingEventArgs e) {
    Debug.Print(e.PropertyType.ToString());
}

but it never asks for any of the Image properties, this is the output even if I update ImageMso and call adxSplitLogin.Invalidate():


Visible
Enabled
Size
ShowCaption
ScreenTip
Caption


I also see threads about a GetImage function you can configure on the ribbon xml but I can't seem to find anything like that in ADX.
Posted 25 Sep, 2021 14:17:30 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello GJ,

Try changing the image by directly setting the corresponding property of the ADXRibbonButton component. That is, outside of the PropertyChanging event.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 27 Sep, 2021 03:43:45 Top
gjvdkamp




Posts: 56
Joined: 2018-08-28
Nope, tried setting:
ImageMSO
Imagelist + Image
Glyph

None of them have any effect. This seems like a pretty basic thing, am I missing something here..?
Posted 27 Sep, 2021 11:40:18 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello GJ,

If you have ImageMso set, then Microsoft provides no way to change it on the fly.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 27 Sep, 2021 12:14:46 Top
gjvdkamp




Posts: 56
Joined: 2018-08-28
Ok thx.
Posted 27 Sep, 2021 13:09:44 Top