博文
变幻魔方(2007-08-28 20:35:00)
摘要:
实现代码为:
Option Explicit
Private Sub Form_Load()
Label1(0).Visible = False
Dim mytop As Integer, myleft As Integer
Dim i As Integer, j As Integer, k As Integer
mytop = 0
For i = 1 To 8
myleft = 0
For j = 1 To 8
k = (i - 1) * 8 + j
Load Label1(k)
Label1(k).BackColor = IIf((i + j) Mod 2 = 0, vbWhite, vbBlack)
Label1(k).Visible = True
Label1(k).Caption = ""
Label1(k).Top = mytop
Label1(k).Left = myleft
myleft = myleft + Label1(0).Width
Next j
mytop = mytop + Label1(0).Height
Next i
End Sub
Private Sub Label1_Click(Index As Integer)
Dim i As Integer, j As Integer, k ......