http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=20987&lngWId=1www.google.com 关键字:Outlook控件 OR 仿QQ控件 vertmenu 工具栏控件,可以建立Delphi那样可以滚动的、多页面的横向工具栏。也可以建立类似VB、Outlook那样的纵向的,包含多个切换面板的工具栏。支持位图作为背景。推荐下载:http://www.applevb.com/sourcecode/toolboxocx.zip程序运行效果: http://www.applevb.com/sourcecode/toolboxocx.jpg
http://www.dreamdee.cn.gs/vbocx/vertmenu.zip
'1200为按钮宽度,300为高度,请自行修改为需要的尺寸 Private Sub Form_Load() Me.WindowState = 2 With Picture1 .Width = 1200 + 60 .Height = 7900 End With Dim i As Integer For i = Command1.Count - 1 To 0 Step -1 With Command1(i) .Width = 1200 .Height = 300 .Top = Picture1.ScaleHeight - 300 * (Command1.Count - i) .Left = 0 .Caption = "QBColor " & i End With Next i Command1(0).Top = 0 End Sub '注:如果你在设计时就把各控件的位置及尺寸一一设定好, '那么上面的代码就可以全部省略了 Private Sub Command1_Click(Index As Integer) Picture1.SetFocus '把焦点给Picture1是为了不让按钮出现难看的黑框 Dim i As Integer For i = 1 To Index Command1(i).Top = 300 * i Next i For i = Command1.Count - 1 To Index + 1 Step -1 Command1(i).Top = Picture1.ScaleHeight - 300 * (Command1.Count - i) Next i Me.BackColor = QBColor(Index) End Sub
http://www.vbaccelerator.com/home/VB/Code/Controls/ListBar/Button_List_Bar/article.asp
工具栏控件,可以建立Delphi那样可以滚动的、多页面的横向工具栏。也可以建立类似VB、Outlook那样的纵向的,包含多个切换面板的工具栏。支持位图作为背景。推荐下载:http://www.applevb.com/sourcecode/toolboxocx.zip程序运行效果:
http://www.applevb.com/sourcecode/toolboxocx.jpg
Private Sub Form_Load()
Me.WindowState = 2
With Picture1
.Width = 1200 + 60
.Height = 7900
End With
Dim i As Integer
For i = Command1.Count - 1 To 0 Step -1
With Command1(i)
.Width = 1200
.Height = 300
.Top = Picture1.ScaleHeight - 300 * (Command1.Count - i)
.Left = 0
.Caption = "QBColor " & i
End With
Next i
Command1(0).Top = 0
End Sub
'注:如果你在设计时就把各控件的位置及尺寸一一设定好,
'那么上面的代码就可以全部省略了
Private Sub Command1_Click(Index As Integer)
Picture1.SetFocus '把焦点给Picture1是为了不让按钮出现难看的黑框
Dim i As Integer
For i = 1 To Index
Command1(i).Top = 300 * i
Next i
For i = Command1.Count - 1 To Index + 1 Step -1
Command1(i).Top = Picture1.ScaleHeight - 300 * (Command1.Count - i)
Next i
Me.BackColor = QBColor(Index)
End Sub