codejock 用法记录

1、设置菜单字体大小,菜单高度不变

    RibbonBarActive.CommandBars.Options.Font.Size = 8     

2、设置菜单字体大小,随菜单高度改变

        '系统皮肤
        Dim ControlOptions As XtremeCommandBars.CommandBarPopup
        Set ControlOptions = objRibbonBar.Controls.Add(xtpControlPopup, 0, "系统皮肤")
        ControlOptions.flags = xtpFlagRightAlign
       
        Dim Control2 As XtremeCommandBars.CommandBarControl
        Set Control = ControlOptions.CommandBar.Controls.Add(xtpControlPopup, 0, "皮肤风格")
        Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLEBLUE2007, "Office 2007 Blue"
        Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLESILVER2007, "Office 2007 Silver"
        Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLEBLACK2007, "Office 2007 Black"
        Set Control2 = Control.CommandBar.Controls.Add(xtpControlButton, ID_OPTIONS_STYLEAQUA2007, "Office 2007 Aqua")
        Set Control2 = Control.CommandBar.Controls.Add(xtpControlButton, ID_OPTIONS_STYLEBLUE2010, "Office 2010 Blue")
        Control2.BeginGroup = True
        Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLESILVER2010, "Office 2010 Silver"
        Set Control2 = Control.CommandBar.Controls.Add(xtpControlButton, ID_OPTIONS_STYLEBLACK2010, "Office 2010 Black")
        Set Control2 = Control.CommandBar.Controls.Add(xtpControlButton, ID_OPTIONS_STYLESCENIC7, "Windows 7 Scenic")
        Control2.BeginGroup = True
                    
'        '字体大小
        Set Control = ControlOptions.CommandBar.Controls.Add(xtpControlPopup, 0, "字体大小")
        Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_FONT_SYSTEM, "系统字体"
        Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_FONT_NORMAL, "正常大小"
        Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_FONT_LARGE, "大字体"
        Set Control2 = Control.CommandBar.Controls.Add(xtpControlButton, ID_OPTIONS_FONT_EXTRALARGE, "特大字体")
        Set Control2 = Control.CommandBar.Controls.Add(xtpControlButton, ID_OPTIONS_FONT_AUTORESIZEICONS, "自动大小")

       Private Sub CommandBars1_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)

        Dim FontSizes(3) As Integer
        FontSizes(0) = 0
        FontSizes(1) = 11
        FontSizes(2) = 13
        FontSizes(3) = 16

        Case ID_OPTIONS_FONT_SYSTEM, ID_OPTIONS_FONT_NORMAL, ID_OPTIONS_FONT_LARGE, ID_OPTIONS_FONT_EXTRALARGE
              Dim newFontHeight As Integer
              newFontHeight = FontSizes(Control.id - ID_OPTIONS_FONT_SYSTEM)
              RibbonBarActive.FontHeight = newFontHeight            
         Case ID_OPTIONS_FONT_AUTORESIZEICONS
              CommandBars1.PaintManager.AutoResizeIcons = Not CommandBars1.PaintManager.AutoResizeIcons
              CommandBars1.RecalcLayout
              RibbonBarActive.RedrawBar

        end sub

 

posted @ 2015-11-29 17:40  海云飞  阅读(1296)  评论(0编辑  收藏  举报