Private Sub Form_Load()
Dim t As Integer, l As Integer, i As Integer, j As Integer, k As Integer
Dim color As Integer
t = Shape1(0).Top '记录第一个控件的位置
l = Shape1(0).Left + Shape1(0).Width
For i = 1 To 2
For j = 1 To 2
k = (i - 1) * 2 + j
Load Shape1(k)
Select Case k ' 设置颜色
Case 1
color = 0 '黑色
Case 2
color = 12 '淡红色
Case 3
color = 14 '淡黄色
Case 4
color = 11 '淡青色
End Select
Shape1(k).BorderColor = QBColor(color) '用函数设置颜色
Shape1(k).Visible = True
Shape1(k).Top = t '设置控件位置
Shape1(k).Left = l
l = l + Shape1(0).Width ' 下一列位置
Next j
t = t + Shape1(0).Width / 2 ' 下一行位置
l = Shape1(0).Left + Shape1(0).Width / 2
Next i
End Sub