试试
lockbasemainformIf e.ToggleButton.Pressed=False Then RibbonTabs.AllowMinimize = False ribbontabs.Minimized = False e.ToggleButton.Text="隐藏菜单" Else RibbonTabs.AllowMinimize = True RibbonTabs.Minimized = True e.ToggleButton.Text="显示菜单" End Ifunlockbasemainform