visual studio designer theme

Nov 19, 2013 at 9:07 PM
is there any way to change the default theme that is shown in the designer? i have created a custom theme that i would like to preview in the designer, not only at runtime.
Developer
Nov 23, 2013 at 10:41 AM
You can modify it directly at the source code.
The initial colors of each part are defined in this class:

RibbonProfesionalRendererColorTable.cs

which is currently located at:

Classes\Renderer\Color Tables\RibbonProfesionalRendererColorTable.cs
Nov 23, 2013 at 12:10 PM
Edited Nov 23, 2013 at 12:11 PM
yes, but when you choose the ThemeColor from within the design mode properties (black, halloween, etc.), nothing happens. the default theme remains even after rebuilding. this is with visual studio 2012, .net framework 4.0.
Developer
Nov 26, 2013 at 6:04 AM
try this:
void ChangeToBlackTheme()
{
    Theme.ColorTable = new RibbonProfesionalRendererColorTableBlack();
    ribbon1.Refresh();
}

void ChangeToPurpleTheme()
{
    Theme.ColorTable = new RibbonProfesionalRendererColorTablePurple();
    ribbon1.Refresh();
}

void ChangeTheRibbonBackgroundOnly(System.Drawing.Color color)
{
    Theme.ColorTable.RibbonBackground = color;
    ribbon1.Refresh();
}
Nov 26, 2013 at 10:02 AM
Edited Nov 26, 2013 at 2:41 PM
the colors won't get applied when in designer mode because of the fix put in for things 'blowing up'

in Theme.cs in the ThemeColor property:
                Theme.blnSetOnly = true;
                Theme.ThemeColor = value;
                Theme.blnSetOnly = false;
that flag causes the designer to never update it's colors, because in Theme.cs in the ThemeColor property:
if (blnSetOnly == false) {
 //CHANGES COLORS HERE
}
blnSetOnly is always true in designer mode, apparently. after removing the flag, everything appears to work as expected (changing the theme, changes the colors in design mode)

this flag is also set around changing the ThemeStyle but it's not actually checked when the style is changed, so i wonder if it's still necessary when changing the theme's color.

Edit: however doing so, apparently breaks setting custom themes at runtime.
Edit2: disregard the previous edit, i was trying to change the theme in the main form's constructor. it seems to work ok.