Change the text color of a AdxRibbonItem

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

Change the text color of a AdxRibbonItem
 
Rhys Hicks




Posts: 16
Joined: 2021-01-21
Hello,

We have a dropdown in which I add an AdxRibbonItem to. However under certain circumstances I want to change the color or style of the item that is being entered on an individual item basis. Do you know if this is possble????

This is what we have so far:
 var adxRibbonItem = new AddinExpress.MSO.ADXRibbonItem
 {
 ????????? Caption = addItem,
 ????????? Id = $"adxRibbonItem_{dropdown.Items.Count}",
 ????????? ImageTransparentColor =??? System.Drawing.Color.Transparent,

 };

 dropdown.Items.Add(adxRibbonItem);


"addItem" in this scenario is an object that has a overridden ToString() method on that returns the text that we want.

Please let me know if you would like any more information. Thanks
Posted 21 Jan, 2021 04:32:43 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
Hello Rhys,

The Office Ribbon API doesn't support styling up a Ribbon item. Office defines the style and it doesn't allow you to do this.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Jan, 2021 04:37:41 Top
Rhys Hicks




Posts: 16
Joined: 2021-01-21
Hello Andrei,

Thanks for your quick reply.

Ok that is a shame, are we able to set an item to be disabled or enabled and then add it or is there completely no control on that? Essentially I want to show disabled items in the dropdown.

Thanks
Posted 21 Jan, 2021 04:44:27 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
There's no way to do this. On the Ribbon schema a Ribbon item has these attributes (compare these with ADXRibbonItem properties):
- id
- label
- image
- imageMso
- screentip
- supertip

You can only add/remove items from the parent control.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Jan, 2021 04:58:04 Top
Rhys Hicks




Posts: 16
Joined: 2021-01-21
Ok thank you
Posted 21 Jan, 2021 05:10:00 Top
Andrei Smolin


Add-in Express team


Posts: 18806
Joined: 2006-05-11
You are welcome.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Jan, 2021 05:10:58 Top