Print Page | Close Window

Version 18 Ribbon Office 2016 Theme

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23400
Printed Date: 27 November 2024 at 12:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Version 18 Ribbon Office 2016 Theme
Posted By: jasonl
Subject: Version 18 Ribbon Office 2016 Theme
Date Posted: 31 July 2017 at 8:08pm
I can't find a sample application or any forum posts which show how to use the new 2016 themes.  
I'm assuming you use CommandBarsGlobalSettings.ResourceImages.LoadFromFile but how can I find out what the IniFileNames are in the Office2016.dll?




Replies:
Posted By: olebed
Date Posted: 01 August 2017 at 3:38am
Hello jasonl,

Office2016 theme changed in the same way as Office2013.

SetCommandbarsTheme xtpThemeOffice2013, App.Path & "\..\..\..\Styles\Office2016.dll", "Office2016WordColorful.ini"

INI files are:

Office2016AccessBlack.ini
Office2016AccessColorful.ini
Office2016AccessDarkGray.ini
Office2016AccessWhite.ini

Office2016Excel...
Office2016OneNote...
Office2016Outlook...
Office2016PowerPoint...
Office2016Publisher...
Office2016Word...

Regards,
 Oleksandr Lebed


Posted By: Harry1975
Date Posted: 01 August 2017 at 2:59pm
Exist there an example for the Office 2016 Backstage ?


Posted By: olebed
Date Posted: 02 August 2017 at 12:08pm
Hello Harry1975,

If you load Office2016.dll as CommandBars theme  then Backstage also will get resources from Office2016.
If you ask about  fullscreen Backstage in ActiveX - you can set 
BackstageView.SetTheme 17  'show new fullscreen backstage

17 is xtpThemeOffice2016, but unfortunately we haven't added it to ActiveX version. Now we are working on improving  switching between old backstage and new fullscreen version. So it is temporary solution.

Regards,
 Oleksandr Lebed


Posted By: Harry75
Date Posted: 11 August 2017 at 4:56am
Exist there also an Windows10 cjstyle ?

-------------
Product: Xtreme SuitePro (ActiveX) version 15.3.1 , 16.4 , 17.x , 18.x

Platform: Windows XP (32bit) - SP 3 , Windows 7 SP1 / Win 10 (64bit)

Language: Visual Basic 6.0 SP6


Posted By: olebed
Date Posted: 11 August 2017 at 6:42am
unfortunately we don't have such skin.


Posted By: Nick
Date Posted: 18 January 2018 at 11:17am
I'm using the Office 2016 dll's as suggested, and this works fine for the ribbon bar.  But I can't get the backstage buttons and recent file list controls to adopt the Office 2016 theme.  How do I get this to work?


Posted By: Fritzchen
Date Posted: 18 January 2018 at 4:26pm
I use the backstage buttons in my application also outside of the backstage.

So that the buttons always take on the same color as the color theme (Office2016. dll), I use the following:

Here's where I give the main theme:
BackstageButton.Appearance = xtpAppearanceOffice2013

'Here the background color (I need the buttons e. g. in white):
BackstageButton.BackColor = RGB(255, 255, 255)

'And here the font color.
BackstageButton.ForeColor = strThemeFontColor

'--------------------------------------------

Fill the variable "strThemeFontColor" with the corresponding font color when changing the theme.


Case ID_THEME_01: strStyleINI = "Office2016WordColorful.ini"
                  strThemeFontColor = RGB(42, 87, 154)

Case ID_THEME_02: strStyleINI = "Office2016OutlookColorful.ini"
                  strThemeFontColor = RGB(1, 115, 199)

Case ID_THEME_03: strStyleINI = "Office2016PublisherColorful.ini"
                  strThemeFontColor = RGB(7, 117, 104)

Case ID_THEME_04: strStyleINI = "Office2016ExcelColorful.ini"
                  strThemeFontColor = RGB(34, 116, 71)

Case ID_THEME_05: strStyleINI = "Office2016PowerpointColorful.ini"
                  strThemeFontColor = RGB(183, 71, 42)

Case ID_THEME_06: strStyleINI = "Office2016AccessColorful.ini"
                  strThemeFontColor = RGB(164, 55, 58)

Case ID_THEME_07: strStyleINI = "Office2016OnenoteColorful.ini"
                  strThemeFontColor = RGB(128, 57, 123)

This method may be unconventional but it works
Maybe this will help you.

Many greetings

Fritzchen





Posted By: olebed
Date Posted: 19 January 2018 at 11:42am
Originally posted by Nick Nick wrote:

I'm using the Office 2016 dll's as suggested, and this works fine for the ribbon bar.  But I can't get the backstage buttons and recent file list controls to adopt the Office 2016 theme.  How do I get this to work?


Hello Nick,

You can explore our sample  Samples\CommandBars\C#.NET\RibbonSample\
I have added example how customize Ribbon Backstage Page
//frmMain.cs
private void SetBackstageTheme()
{
    XtremeCommandBars.XTPBackstageButtonControlAppearanceStyle nButtonAppearance = XtremeCommandBars.XTPBackstageButtonControlAppearanceStyle.xtpAppearanceResource;
    XtremeCommandBars.XTPBackstageSeparatorControlAppearanceStyle nSeparatorAppearance = XtremeCommandBars.XTPBackstageSeparatorControlAppearanceStyle.xtpSeparatorAppearanceResource;

    switch (CommandBars.VisualTheme)
    {
        case XtremeCommandBars.XTPVisualTheme.xtpThemeOffice2013:
            nButtonAppearance = XtremeCommandBars.XTPBackstageButtonControlAppearanceStyle.xtpAppearanceOffice2013;
            nSeparatorAppearance = XtremeCommandBars.XTPBackstageSeparatorControlAppearanceStyle.xtpSeparatorAppearanceOffice2013;
            break;
        case XtremeCommandBars.XTPVisualTheme.xtpThemeVisualStudio2015:
            nButtonAppearance = XtremeCommandBars.XTPBackstageButtonControlAppearanceStyle.xtpAppearanceVisualStudio2015;
            nSeparatorAppearance = XtremeCommandBars.XTPBackstageSeparatorControlAppearanceStyle.xtpSeparatorAppearanceVisualStudio2015;
            break;
        default:
            nButtonAppearance = XtremeCommandBars.XTPBackstageButtonControlAppearanceStyle.xtpAppearanceResource;
            nSeparatorAppearance = XtremeCommandBars.XTPBackstageSeparatorControlAppearanceStyle.xtpSeparatorAppearanceResource;
            break;
    }

    BackstageView.SetTheme(CommandBars.VisualTheme);
    
    Color clrText = ColorFromUint( BackstageView.GetForeColor() );
    Color clrBack = ColorFromUint( BackstageView.GetBackColor() );
    
    pageBackstageInfo.SetAppearance(CommandBars.VisualTheme, nButtonAppearance, nSeparatorAppearance, clrText, clrBack);
    pageBackstageHelp.SetAppearance(CommandBars.VisualTheme, nButtonAppearance, nSeparatorAppearance, clrText, clrBack);
    pageBackstageSend.SetAppearance(CommandBars.VisualTheme, nButtonAppearance, nSeparatorAppearance, clrText, clrBack);
    pageBackstageRecent.SetAppearance(CommandBars.VisualTheme, nButtonAppearance, nSeparatorAppearance, clrText, clrBack);
    pageBackstageDisabled.SetAppearance(CommandBars.VisualTheme, nButtonAppearance, nSeparatorAppearance, clrText, clrBack);
}

// pageBackstageSend.cs
public void SetAppearance(XtremeCommandBars.XTPVisualTheme theme, XtremeCommandBars.XTPBackstageButtonControlAppearanceStyle nButtonAppearance,
    XtremeCommandBars.XTPBackstageSeparatorControlAppearanceStyle nSeparatorAppearance, Color clrText, Color clrBack)
{
    this.ForeColor = clrText;
    this.BackColor = clrBack;

    BackstageButton1.Appearance = nButtonAppearance;
    BackstageButton2.Appearance = nButtonAppearance;
    btnManageVersions.Appearance = nButtonAppearance;
    btnProtectDocument.Appearance = nButtonAppearance;

    BackstageButton1.ForeColor = clrText;
    BackstageButton1.BackColor = clrBack;
    BackstageButton2.ForeColor = clrText;
    BackstageButton2.BackColor = clrBack;    
..............

    BackstageButton1.TextImageRelation = XtremeCommandBars.TextImageRelationStyle.xtpImageAboveText;
    BackstageButton2.TextImageRelation = XtremeCommandBars.TextImageRelationStyle.xtpImageAboveText;

    btnTab_0.Appearance = nButtonAppearance;
    btnTab_1.Appearance = nButtonAppearance;    
..............

    btnTab_0.ForeColor = clrText;
    btnTab_0.BackColor = clrBack;    
..............

    lblBackstageSeparator1.Appearance = nSeparatorAppearance;
    lblBackstageSeparator4.Appearance = nSeparatorAppearance;

    BackstageSeparator1.Appearance = nSeparatorAppearance;
    BackstageSeparator2.Appearance = nSeparatorAppearance;    
..............
    
    Label1.ForeColor = clrText;
    Label1.BackColor = clrBack;
    Label2.ForeColor = clrText;
    Label2.BackColor = clrBack;    
..............

    tabPage_0.ForeColor = clrText;
    tabPage_0.BackColor = clrBack;    
..............

}

Regards,
 Oleksandr Lebed


Posted By: Nick
Date Posted: 20 January 2018 at 7:16am
thanks guys Smile.  I've got the backstage buttons and separator ok now based on what you've shown as examples.  I'm actually doing it this way now rather than changing each individual control...

Public Sub ChangeButtonTheme(xObject As Object)
'- object can be a form or a usercontrol
   Dim xButton As Control
   Dim btnStyle As XTPBackstageButtonControlAppearanceStyle
   Dim sepStyle As XTPBackstageSeparatorControlAppearanceStyle

   Select Case CurrentRibbonTheme
   Case ID_OPTIONS_STYLESYSTEM
      btnStyle = xtpAppearanceStandard
      sepStyle = xtpSeparatorAppearanceResource
   Case ID_OPTIONS_STYLE2007BLUE To ID_OPTIONS_STYLE2007AQUA
      btnStyle = xtpAppearanceOffice2007
      sepStyle = xtpSeparatorAppearanceResource
   Case ID_OPTIONS_STYLE2013WHITE To ID_OPTIONS_STYLE2013DARKGREY
      btnStyle = xtpAppearanceOffice2013
      sepStyle = xtpSeparatorAppearanceOffice2013
   Case ID_OPTIONS_STYLE2016WHITE To ID_OPTIONS_STYLE2016COLORFUL
      btnStyle = xtpAppearanceOffice2013
      sepStyle = xtpSeparatorAppearanceOffice2013
   Case ID_OPTIONS_STYLEVISUALSTUDIO2015BLUE To ID_OPTIONS_STYLEVISUALSTUDIO2015LIGHT
      btnStyle = xtpAppearanceVisualStudio2015
      sepStyle = xtpAppearanceVisualStudio2015
   Case ID_OPTIONS_STYLE2016WHITE To ID_OPTIONS_STYLE2016COLORFUL
      btnStyle = xtpAppearanceOffice2013
      sepStyle = xtpSeparatorAppearanceResource
      '- codejock example uses resource for both
   Case Else
      btnStyle = xtpAppearanceResource
      sepStyle = xtpSeparatorAppearanceResource
   End Select
  
   For Each xButton In xObject.Controls
      If TypeOf xButton Is BackstageButton Then
         xButton.Appearance = btnStyle
         xButton.ForeColor = mainForm.BackstageView.GetForeColor
         xButton.BackColor = mainForm.BackstageView.GetBackColor
        
      ElseIf TypeOf xButton Is BackstageSeparator Then
         xButton.Appearance = sepStyle
      End If
   Next
End Sub


There's still an issue with the BackstageListBox (for a recent file list) though - it fails to pick up any of the themes (not just the office 2016 one) and it fails to show the appropriate icon associated with the file type.  Codejock's own examples (VB RibbonSample) don't work either as from v17.1.0, though v16.4.0 does work.  For example, try the Visual Studio 2015 dark theme in Codejock's examples, and you'll see what I mean.  So this appears to be a bug that's been around for a couple of years Cry


Posted By: olebed
Date Posted: 20 January 2018 at 3:01pm
I have moved  discussion about Shell Icons in BackstagePageRecent to http://forum.codejock.com/forum_posts.asp?TID=23547" rel="nofollow - this separate topic  


Posted By: Nick
Date Posted: 28 July 2018 at 2:18am
still not solved in 18.4.0, so still needs a workaround (involving forcing the form background to white irrespective of the theme background



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net