📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form form1
Caption = "控件数组"
ClientHeight = 3480
ClientLeft = 60
ClientTop = 345
ClientWidth = 5010
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3480
ScaleWidth = 5010
StartUpPosition = 2 '屏幕中心
Begin VB.Label Label1
BackColor = &H80000007&
ForeColor = &H00FFFFFF&
Height = 495
Index = 0
Left = 0
TabIndex = 0
Top = 0
Width = 615
End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
'******************************************************************
'************** 过程名称:Form_Load
'************** 参数: 无
'******************************************************************
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
'******************************************************************
'************** 过程名称:Label1_Click
'************** 参数:Index 为Integer型
'******************************************************************
Private Sub Label1_Click(Index As Integer)
Label1(Index) = 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
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -