'一个picture1,里面放command1数组0-15Private 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 SubPrivate Sub Command1_Click(Index As Integer) Picture1.SetFocus 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
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 SubPrivate Sub Command1_Click(Index As Integer)
Picture1.SetFocus
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.21code.com/codebase/?pos=down&id=622
http://www.21code.com/codebase/?pos=down&id=1505
http://www.21code.com/codebase/?pos=down&id=1467
很多控件呀