📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "控件数组"
ClientHeight = 6870
ClientLeft = 60
ClientTop = 450
ClientWidth = 6900
LinkTopic = "Form1"
ScaleHeight = 6870
ScaleWidth = 6900
StartUpPosition = 1 '所有者中心
Begin VB.Label Label1
BackColor = &H80000007&
Height = 855
Index = 0
Left = 0
TabIndex = 0
Top = 0
Width = 855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim mtop As Integer, mleft As Integer, i As Integer, j As Integer, k As Integer
mtop = 0
For i = 1 To 8
mleft = 50
For j = 1 To 8
k = (i - 1) * 8 + j
Load Label1(k)
Label1(k).BackColor = IIf((i + j) Mod 2 = 0, QBColor(0), QBColor(15))
Label1(k).Visible = True
Label1(k).Top = mtop
Label1(k).Left = mleft
mleft = mleft + Label1(0).Width
Next j
mtop = mtop + Label1(0).Height
Next i
End Sub
Private Sub Label1_Click(Index As Integer)
Label1(Index).Caption = Index
For i = 1 To 8
For j = 1 To 8
k = (i - 1) * 8 + j
If Label1(k).BackColor = &H0& Then
Label1(k).BackColor = &HFFFFFF
Else
Label1(k).BackColor = &H0&
End If
Next j
Next i
Label1(0).BackColor = Label1(1).BackColor
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -