以下是在程序中使用的部分代码:
Dim oTool As Tool
acbToolBar.Bands.Add "系统工程"
With acbToolBar.Bands("系统工程")
Set oTool = .Tools.Add(0, "miProjLoad")
oTool.Caption = "&ProjLoad"
oTool.SetPicture Index:=0, Picture:=LoadPicture( _
App.Path & "\图标配置\工具栏图标\系统工程\ProjLoad.ico"), Color:=&HC0C0C0
oTool.Width = 15
oTool.ToolTipText = "载入工程"
oTool.BeginGroup = True
Set oTool = .Tools.Add(1, "miProjSave")
oTool.Caption = "&ProjSave"
oTool.SetPicture Index:=0, Picture:=LoadPicture( _
App.Path & "\图标配置\工具栏图标\系统工程\ProjSave.ico"), Color:=&HC0C0C0
oTool.Width = 15
oTool.ToolTipText = "保存工程"
Set oTool = .Tools.Add(2, "miProjClose")
oTool.Caption = "&ProjClose"
oTool.SetPicture Index:=0, Picture:=LoadPicture( _
App.Path & "\图标配置\工具栏图标\系统工程\ProjClose.ico"), Color:=&HC0C0C0
oTool.Width = 15
oTool.ToolTipText = "关闭工程"
文章来源于领测软件测试网 https://www.ltesting.net/