怎样利用vb中的shape来编写一个棋盘
Dim mtop%, mleft%, i%, j%
mtop = 0
For i = 1 To 19
mleft = 50
mtop = mtop + Shapel(0).Height
Next i
For j = 1 To 19
k = (i - 1) * 19 + j
Next j
Load Shapel(k)
If k Mod 2 = 0 Then
Shapel(k).BackColor = QBColor(0)
Shapel(k).Visible = True
Shapel(k).Top = mtop
Shapel(k).Left = mleft
End If
End Sub
这个哪里错了,调试不过来 展开
'怎样利用vb中的shape来编写一个棋盘
'先在 Form 中创建一个 Shape1 数组,只留下 Shape1(0),其他删掉。
Private Sub Form_Load()
Dim a As Integer
a = Shape1(0).Height
Shape1(0).Width = Shape1(0).Height
Dim i As Integer, j As Integer, k As Integer
For i = 1 To 19
For j = 1 To 19
k = (i - 1) * 19 + j
Load Me.Shape1(k)
With Shape1(k)
If k Mod 2 = 0 Then
.BackStyle = 1
.BackColor = 0
End If
.Top = (i - 1) * a
.Left = (j - 1) * a
.Visible = True
End With
Next
Next
End Sub
在请问一下, Load Me.Shape1(k )With Shape1(k)这段是什么意思
Load Me.Shape1(k) 表示加载一个新 Shape
With Shape1(k) ...... End With 之间的语句表示对新 Shape 对象的属性进行设置