VBshape控件运行后随时间的变化而有不同的形状和颜色
1个回答
展开全部
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Randomize
i = Int(Rnd * 6)
Shape1.Shape = i '生成的0到5之间的随即数,对应shape属性
If i = 1 Then
Shape1.BackColor = &HFF& 'shape的颜色随i的不同变换,颜色可以继续加
ElseIf i = 3 Then
Shape1.BackColor = &HFF0000
Else
Shape1.BackColor = &HFFFF&
End If
End Sub
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Randomize
i = Int(Rnd * 6)
Shape1.Shape = i '生成的0到5之间的随即数,对应shape属性
If i = 1 Then
Shape1.BackColor = &HFF& 'shape的颜色随i的不同变换,颜色可以继续加
ElseIf i = 3 Then
Shape1.BackColor = &HFF0000
Else
Shape1.BackColor = &HFFFF&
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询