翻譯|使用教程|編輯:鮑佳佳|2020-07-08 17:29:41.833|閱讀 913 次
概述:本文將介紹如何使用CommandBars 在同一行上添加一個(gè)或多個(gè)工具欄附代碼教程
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
Codejock 公司的Xtreme Command Bars 提供非常漂亮的Office風(fēng)格的命令條和One Note樣式的Tab. 這種構(gòu)架完全支持菜單和工具欄的個(gè)性化設(shè)置, 它將在應(yīng)用程序工作臺(tái)上給你更大的控制權(quán), Xtreme Command Bars 提供嵌入式主題支持,允許你選擇預(yù)先定義的主題如Officexp、Office 2003、 Visual Studio .NET,或者自定義主題。本文主要介紹如何使用CommandBars控件操作多個(gè)工具欄。
點(diǎn)擊下載Xtreme Command Bars最新試用版
默認(rèn)情況下,添加工具欄時(shí),該工具欄將顯示在單獨(dú)的行上。每個(gè)添加的工具欄將出現(xiàn)在前一個(gè)工具欄的下方。但是,很多時(shí)候使用代碼將工具欄??吭谕恍兄?是非常有必要的。
在下面的圖片中,您可以看到工具欄#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, False Private 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 If End Sub
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn