是用Fillcolor而不是用Backcolor
Option Explicit
Private Sub Form_Click()
Static i As Integer
Shape1.FillStyle = 0
If i = 0 Then
Shape1.FillColor = vbRed
ElseIf i = 1 Then
Shape1.FillColor = vbGreen
ElseIf i = 2 Then
Shape1.FillColor = vbYellow
End If
i = i + 1
If i = 3 Then
i = 0
End If
End Sub
代码没错,
加入下面一句:
Shape1.FillStyle = 0
把 Static i As Integer 放sub过程 外试试
.
没问题啊