[求助]工具栏的操作按钮,其功能的代码
奇怪用下面的怎么不行呀?
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Caption
Case "Open": MsgBox "Open"
Case "Save": MsgBox "Save"
Case "Charts": MsgBox "Charts"
End Select
End Sub
Private Sub UserForm_Initialize()
With Toolbar1
.AllowCustomize = False '双击不显
.ImageList = ImageList1 '连接图标
.TextAlignment = tbrTextAlignRight '图标显示方式
End With
With Toolbar1.Buttons
.Add(1, , "").Style = tbrPlaceholder
.Add(2, , , , 1).Caption = "Open"
.Add(3, , , , 2).Caption = "Save"
.Add(4, , , , 3).Caption = "Charts"
End With
End Sub
[此贴子已经被作者于2007-7-3 21:41:20编辑过]