Private Sub Form_Load() fnCriarMenu fnConfiguraCor End Sub
Function fnCriarMenu() Dim Control As CommandBarControl Dim ControlFile As CommandBarPopup, ControlEdit As CommandBarPopup, ControlView As CommandBarPopup Dim ControlWindow As CommandBarPopup, ControlHelp As CommandBarPopup '----------------------------------------------------------- ---------------------------------------- 'Configurações Iniciais '----------------------------------------------------------- ---------------------------------------- CommandBarsGlobalSettings.App = App
'----------------------------------------------------------- ---------------------------------------- 'Menu de Arquivo '----------------------------------------------------------- ---------------------------------------- Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Arquivo", -1, False) With ControlFile.CommandBar.Controls Set Control = .Add(xtpControlButton, ID_ARQUIVO_NOVO, "&Nova", -1, False) .Add xtpControlButton, ID_ARQUIVO_CONFIRMAR, "Confirmar", -1, False 'Separador Set Control = .Add(xtpControlButton, ID_ARQUIVO_CUSTOMISE, "Cus&tomizar", -1, False) Control.BeginGroup = True .Add xtpControlButton, ID_ARQUIVO_GERENCIADOR, "&Gerenciador", -1, False 'separador Set Control = .Add(xtpControlButton, ID_ARQUIVO_PRINTSETUP, "Configurar &Impressora...", -1, False) Control.BeginGroup = True 'Separador Set Control = .Add(xtpControlButton, ID_ARQUIVO_FECHAR, "&Fechar", -1, False) Control.BeginGroup = True End With 'Configura Teclas de Atalho CommandBars.KeyBindings.Add FCONTROL, Asc("N"), ID_ARQUIVO_NOVO CommandBars.KeyBindings.Add 0, VK_F2, ID_ARQUIVO_CONFIRMAR CommandBars.KeyBindings.Add FCONTROL, Asc("T"), ID_ARQUIVO_CUSTOMISE CommandBars.KeyBindings.Add FCONTROL, Asc("G"), ID_ARQUIVO_GERENCIADOR CommandBars.KeyBindings.Add FCONTROL, Asc("I"), ID_ARQUIVO_PRINTSETUP CommandBars.KeyBindings.Add 0, VK_ESCAPE, ID_ARQUIVO_FECHAR '----------------------------------------------------------- ---------------------------------------- 'Menu Editar '----------------------------------------------------------- ---------------------------------------- Set ControlEdit = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Editar", -1, False) With ControlEdit.CommandBar.Controls .Add xtpControlButton, ID_EDIT_UNDO, "&Desfazer", -1, False 'Separador Set Control = .Add(xtpControlButton, ID_EDIT_CUT, "&Recortar", -1, False) Control.BeginGroup = True .Add xtpControlButton, ID_EDIT_COPY, "&Copiar", -1, False .Add xtpControlButton, ID_EDIT_PASTE, "Co&lar", -1, False End With 'Configura Teclas de Atalho CommandBars.KeyBindings.Add FCONTROL, Asc("Z"), ID_EDIT_UNDO CommandBars.KeyBindings.Add FCONTROL, Asc("X"), ID_EDIT_CUT CommandBars.KeyBindings.Add FCONTROL, Asc("C"), ID_EDIT_COPY CommandBars.KeyBindings.Add FCONTROL, Asc("V"), ID_EDIT_PASTE '----------------------------------------------------------- ---------------------------------------- 'Menu Ferramentas '----------------------------------------------------------- ---------------------------------------- Set ControlFerramentas = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Ferramentas", -1, False) With ControlFerramentas.CommandBar.Controls Set Control = .Add(xtpControlPopup, 0, "Microsoft &Office", -1, False) Control.CommandBar.Controls.Add xtpControlButton, ID_FERRAMENTAS_OFFICE_EXCEL, "Microsoft Office &Excel", -1, False Control.CommandBar.Controls.Add xtpControlButton, ID_FERRAMENTAS_OFFICE_WORD, "Microsoft Office &Word", -1, False Control.CommandBar.Controls.Add xtpControlButton, ID_FERRAMENTAS_OFFICE_OUTLOOK, "Microsoft Office &Outlook", -1, False Control.CommandBar.Controls.Add xtpControlButton, ID_FERRAMENTAS_OFFICE_POWERPOINT, "Microsoft Office &PowerPoint", -1, False Set Control = .Add(xtpControlButton, ID_FERRAMENTAS_CALCULATOR, "&Calculadora", -1, False) Control.BeginGroup = True .Add xtpControlButton, ID_FERRAMENTAS_NOTEPAD, "&Bloco de notas", -1, False .Add xtpControlButton, ID_FERRAMENTAS_WORDPAD, "&WordPad", -1, False .Add xtpControlButton, ID_FERRAMENTAS_ChARMAP, "&Mapa de caracteres", -1, False Set Control = .Add(xtpControlButton, ID_FERRAMENTAS_EXPLORER, "&Windows Explorer", -1, False) .Add xtpControlButton, ID_FERRAMENTAS_IEXPLORER, "&Internet Explorer", -1, False Control.BeginGroup = True End With '----------------------------------------------------------- ---------------------------------------- 'Menu Relatório '----------------------------------------------------------- ---------------------------------------- Set ControlRelatorio = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Relatórios", -1, False) With ControlRelatorio.CommandBar.Controls .Add xtpControlButton, ID_RELATORIO_ENTREGA, "&Comprovante de Entrega", -1, False .Add xtpControlButton, ID_RELATORIO_CONTRATO, "Comprovante com Con&trato", -1, False 'Separador Set Control = .Add(xtpControlButton, ID_RELATORIO_ORCAMENTO, "&Orçamento", -1, False) Control.BeginGroup = True End With '----------------------------------------------------------- ---------------------------------------- 'Menu Ajuda '----------------------------------------------------------- ---------------------------------------- Set ControlAjuda = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Ajuda", -1, False) With ControlAjuda.CommandBar.Controls .Add xtpControlButton, ID_AJUDA_CONTESTO, "&Contesto", -1, False 'Separador Set Control = .Add(xtpControlButton, ID_AJUDA_SOBRE, "&Sobre...", -1, False) Control.BeginGroup = True End With 'Configura Teclas de Atalho CommandBars.KeyBindings.Add 0, VK_F1, ID_AJUDA_CONTESTO
'----------------------------------------------------------- ---------------------------------------- 'Configurações Finais '----------------------------------------------------------- ---------------------------------------- CommandBars.EnableCustomization (True) CommandBars.VisualTheme = xtpThemeOffice2003 End Function
Function fnConfiguraCor() CommandBars.VisualTheme = xtpThemeOfficeXP
'Cor de Fundo do menu CommandBars.GlobalSettings.ColorManager.SetColor STDCOLOR_BTNFACE, RGB(91, 91, 91)
'Cor do Separador CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_SEPARATOR, RGB(91, 91, 91)
'Barra Esquerda do Menu ativo CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_TOOLBAR_FACE, RGB(70, 70, 70)
'Não sei CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_SPLITTER_FACE, RGB(190, 90, 90)
'Pontos inicial do menu CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_TOOLBAR_GRIPPER, vbWhite
'Cor das opções do menu quando está selecionada CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT, RGB(70, 70, 70)
'Cor da borda das opções do menu quando está selecionada CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_BORDER, RGB(60, 60, 60)
'não sei CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_CHECKED, RGB(255, 223, 127) CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_CHECKED_BORDER, RGB(255, 223, 127) CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_PUSHED_BORDER, RGB(255, 223, 127) CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_PUSHED, RGB(255, 223, 127)
'Cor de fundo do menu quando aberto CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_MENUBAR_FACE, RGB(90, 90, 90)
'Cor da Borda do Menu CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_MENUBAR_BORDER, RGB(60, 60, 60)
'Cor da Sombra do menu CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_3DSHADOW, 0 CommandBars.GlobalSettings.ColorManager.SetColor STDCOLOR_BTNSHADOW, 0
'Modifica Texto Dim newFont As StdFont Set newFont = New StdFont With newFont .Bold = False .Italic = False .Name = "Tahoma" .Size = 8 .Underline = False .Strikethrough = False End With Set CommandBars.Options.Font = newFont
'Cor do texto do menu principal CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_TOOLBAR_TEXT, vbWhite 'Cor do texto do menu quando aberto CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_MENUBAR_TEXT, vbWhite ' CommandBars.GlobalSettings.ColorManager.SetColor STDCOLOR_BTNTEXT, vbWhite
'RGB(112, 112, 112) => Cor do texto desabilitado
CommandBars.GlobalSettings.ColorManager.SetColor XPCOLOR_HIGHLIGHT_TEXT, RGB(255, 223, 127)
'Outras Configurações CommandBars.Options.Animation = xtpAnimateWindowsDefault CommandBars.Options.LunaColors = False CommandBars.RecalcLayout
End Function
Obs: Não está completamente pronto, falta terminar algumas coisas. Mas acho que tem como ficar igual ao o Money
|