Print Page | Close Window

Ribbon Font

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=6372
Printed Date: 13 June 2025 at 4:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbon Font
Posted By: DonB
Subject: Ribbon Font
Date Posted: 11 February 2007 at 4:54pm

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



Replies:
Posted By: DonB
Date Posted: 11 February 2007 at 5:44pm

After a fresh shower :)  Could there be a boolean property to just follow metrics?  That way you do what you do very well and all we have to worry about are dumb controls.  Something simple, .GlobalSettings.FollowMetrics = True.  No worrying about when properties are set, objects are created etc.  Anyway, just a thought.  Regards, Don



Posted By: DonB
Date Posted: 12 February 2007 at 2:52pm
Windows XP with Segoe UI font installed, ribbon tab font never changes, the font is small and can't change size.  Uninstall Segoe UI and problem goes away.


Posted By: DonB
Date Posted: 14 February 2007 at 1:23am

Something is going on with Ribbon and fonts.  Use toolbars that come canned with VB6 and never had to touch them.  Large and Extra Large fonts now get reduced.  No Ribbon, canned toolbar font follows system like normal.



Posted By: DonB
Date Posted: 14 February 2007 at 1:28am
Oops, last message should be in SkinFramework section.



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