Samples produce proper behavior depending on Windows font settings. Even changing on the fly using Appearance dialog, font changes w/system. Looking at your code, nothing w/fonts except in the options section to change size. For the life of me, can not produce same effect. I have some Win2K TS folks, so use 2 flavors in testing. Ribbon or Office 2000 look. I call this routine from every Form using XCB's.
Sub XCommandBarsSetup(oCB As XtremeCommandBars.CommandBars, _ oRibbon As XtremeCommandBars.RibbonBar, _ oControlBox As XtremeCommandBars.CommandBarPopup)
With oCB .GlobalSettings.App = App .EnableCustomization True .LoadDesignerBars .Icons.MaskColor = vbMagenta If (m_NCM.ColorDepth < COLOR32_eCD) Then ReplaceIcons oCB End If .StatusBar.AddPane 0 With .StatusBar.Pane(0) .Style = SBPS_STRETCH .Text = C_Ready End With If (m_NCM.ColorDepth > COLOR8_eCD) Then .Options.SetIconSize True, 32, 32 Dim i As Long Do While (.Count > 0) .Item(1).Delete Loop Set oRibbon = .AddRibbonBar(C_Ribbon) With oRibbon .SetFlags xtpFlagHideMDIButtons, 0 .EnableDocking xtpFlagStretched .EnableFrameTheme .ShowCaptionAlways = False Set oControlBox = .AddSystemButton() End With .VisualTheme = xtpThemeOffice2007 .EnableOffice2007Frame True Else .Item(1).SetFlags xtpFlagHideMDIButtons, 0 .Options.SetIconSize True, 24, 24 .VisualTheme = xtpThemeOffice2000 End If End With End Sub
If I do nothing and user has Large or Extra Large fonts set, XCB has normal font sizes. Like sample I want to do nothing with Menu/Ribbon and follow user settings. I change all other controls to reflect user settings but XCB is causing grief. The only way I can get desired result was to do this:
Private Sub pCommandBarsFont() ' If bForm_Activate Then With Me!CB Set .Options.Font = NCM.Font(MenuFont_NCM) Set .StatusBar.Font = .Options.Font If Not (m_Ribbon Is Nothing) Then Set m_Ribbon.TabPaintManager.Font = .Options.Font Set m_Ribbon.RibbonPaintManager.CaptionFont = .Options.Font m_Ribbon.FontHeight = NCM.FontHeight m_Ribbon.RecalcLayout End If .PaintManager.RefreshMetrics .RecalcLayout End With End If ' End Sub
This does produce desired results except for the Title Bar size which remains Normal size no matter what. Is there a particular order to do things that produce same results as your sample. Thanks in advance, Don
|