Xtreme Command Bars最新试用版
默认情况下,添加工具栏时,该工具栏将显示在单独的行上。每个添加的工具栏将出现在前一个工具栏的下方。但是,很多时候使用代码将工具栏停靠在同一行中是非常有必要的。
在下面的图片中,您可以看到工具栏#2已停靠在工具栏#1旁边。这是使用代码完成的。

'Parameters:' BarToDock - ToolBar to be placed to' - the RIGHT of another ToolBar' BarOnLeft - ToolBar that will be on the LEFT side of BarToDock' VerticalBar - Set to false if the toolbars are docked at the' top or bottom of the window (horizontal), set to' true if the toolbars are on the left or right of' the window (vertical).'sample usage:' Dim ToolBar1 As CommandBar, ToolBar2 As CommandBar' ..........Add controls to toolbars' DockRightOf ToolBar2, ToolBar1, FalsePrivate Sub DockRightOf(BarToDock As CommandBar, _ BarOnLeft As CommandBar, VerticalBar As Boolean) Dim Left As Long Dim Top As Long Dim Right As Long Dim Bottom As Long Dim LeftBar As CommandBar Set LeftBar = BarOnLeft CommandBars.RecalcLayout BarOnLeft.GetWindowRect Left, Top, Right, Bottom LeftBar.GetWindowRect Left, Top, Right, Bottom If (VerticalBar = False) Then CommandBars.DockToolBar BarToDock, Right, _ (Bottom + Top) / 2, LeftBar.Position Else CommandBars.DockToolBar BarToDock, (Left + Right) _ / 2, Bottom, LeftBar.Position End IfEnd Sub
如果你对我们的产品感兴趣或者有任何疑问,欢迎咨询在线客服>>
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!