Message 1 of 27
How to change Revit ribbon tab color?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am currently struggling with changing the color of tab header on the Revit ribbon. I have attempted to source answers from The Building Coder's Pimp my AutoCAD or Revit Ribbon blog among others, but have been unable to get the results I am seeking. As you can see from the image below I can get the panel background to color using a TabThem. The TabTheme has allows me to set TabHeaderBackground and TabHeaderForeground, which I would have thought would be what I was looking for. I would have expected my below code to color the panel background and the tab header orange.
I would be grateful for any advice anyone could offer to point me in the right direction to getting the tab header to change color.
adWin.RibbonControl ribbon = adWin.ComponentManager.Ribbon;
LinearGradientBrush gB = new LinearGradientBrush();
gB.StartPoint = new System.Windows.Point(0, 0);
gB.EndPoint = new System.Windows.Point(0, 1);
gB.GradientStops.Add(new GradientStop(Colors.Orange, 0.0));
gB.GradientStops.Add(new GradientStop(Colors.Orange, 1));
Autodesk.Internal.Windows.TabTheme myTheme = new
Autodesk.Internal.Windows.TabTheme();
myTheme.PanelBackground = gB;
myTheme.TabHeaderBackground = gB;
myTheme.TabHeaderForeground = gB;
ribbon.FindTab("BIM TOOLS").Theme = myTheme;