.....
.....
End Sub
Public Sub UpdateBackstageTheme()
Dim nTheme As XtremeCommandBars.XTPBackstageButtonControlAppearanceStyle
Dim RibbonBar As RibbonBar
Dim BackstageView As RibbonBackstageView
Set RibbonBar = CommandBars.ActiveMenuBar
If Not TypeOf RibbonBar.SystemButton.CommandBar Is RibbonBackstageView Then
CreateBackstageView
End If
Set BackstageView = RibbonBar.SystemButton.CommandBar
Select Case CommandBars.VisualTheme
Case xtpThemeOffice2013
nTheme = xtpAppearanceOffice2013
BackstageView.SetTheme xtpThemeOffice2013
Case xtpThemeVisualStudio2015
nTheme = xtpAppearanceVisualStudio2015
BackstageView.SetTheme xtpThemeVisualStudio2015
Case Else
nTheme = xtpAppearanceResource
BackstageView.SetTheme xtpThemeRibbon
End Select
If Not (pageBackstageInfo Is Nothing) Then
pageBackstageInfo.SetAppearance nTheme, CommandBars
pageBackstageInfo.SetColorsFromBackstageView BackstageView
End If
If Not (pageBackstageHelp Is Nothing) Then
pageBackstageHelp.SetAppearance nTheme, CommandBars
pageBackstageHelp.SetColorsFromBackstageView BackstageView
End If
If Not (pageBackstageSend Is Nothing) Then
pageBackstageSend.SetAppearance nTheme, CommandBars
pageBackstageSend.SetColorsFromBackstageView BackstageView
End If
If Not (pageBackstageRecent Is Nothing) Then
pageBackstageRecent.SetAppearance nTheme
pageBackstageRecent.SetColorsFromBackstageView BackstageView
End If
If Not (pageBackstagePrint Is Nothing) Then
pageBackstagePrint.SetAppearance nTheme, CommandBars
pageBackstagePrint.SetColorsFromBackstageView BackstageView
End If
End Sub
Sub CreateBackstageView()
Dim RibbonBar As RibbonBar
Set RibbonBar = CommandBars.ActiveMenuBar
Dim BackstageView As RibbonBackstageView
Set BackstageView = CommandBars.CreateCommandBar("CXTPRibbonBackstageView")
Set RibbonBar.AddSystemButton.CommandBar = BackstageView
BackstageView.AddCommand ID_FILE_SAVE, "Save"
BackstageView.AddCommand ID_FILE_SAVE_AS, "Save As"
BackstageView.AddCommand ID_FILE_OPEN, "Open"
BackstageView.AddCommand ID_FILE_CLOSE, "Close"
If (pageBackstageInfo Is Nothing) Then Set pageBackstageInfo = New pageBackstageInfo
If (pageBackstageSend Is Nothing) Then Set pageBackstageSend = New pageBackstageSend
If (pageBackstageRecent Is Nothing) Then
Set pageBackstageRecent = New pageBackstageRecent
Set pageBackstageRecent.RecentFileList = CommandBars.RecentFileList
End If
If (pageBackstageHelp Is Nothing) Then Set pageBackstageHelp = New pageBackstageHelp
If (pageBackstagePrint Is Nothing) Then Set pageBackstagePrint = New pageBackstagePrint
Dim ControlInfo As RibbonBackstageTab
Set ControlInfo = BackstageView.AddTab(1000, "Info", pageBackstageInfo.hwnd)
BackstageView.AddTab ID_BACKSTAGETAB_RECENT, "Recent", pageBackstageRecent.hwnd
BackstageView.AddTab ID_BACKSTAGETAB_PRINT, "Print", pageBackstagePrint.hwnd
BackstageView.AddTab 1002, "Save && Send", pageBackstageSend.hwnd
BackstageView.AddTab 1001, "Help", pageBackstageHelp.hwnd
BackstageView.AddCommand ID_FILE_OPTIONS, "Options"
BackstageView.AddCommand ID_APP_EXIT, "Exit"
ControlInfo.DefaultItem = True
CommandBars.Icons.LoadBitmap App.Path & "\res\BackstageIcons.png", _
Array(ID_FILE_SAVE, ID_FILE_SAVE_AS, ID_FILE_OPEN, ID_FILE_CLOSE, ID_FILE_OPTIONS, ID_APP_EXIT), xtpImageNormal
End Sub
Private Sub CreateRibbonBar()
.... UpdateBackstageTheme 'instead of CreateBackstageView ....
End Sub