这是一个用5个Shape控件,一个时钟控件来显示鼠标阴影(轨迹)
Private intX As Integer
Private intY As Integer
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
intX = x
intY = y
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Dim r As Integer
Dim g As Integer
Dim b As Integer
For i = 4 To 1 Step -1
Shape1(i).Move Shape1(i - 1).Left, Shape1(i - 1).Top
r = Rnd * 255
g = Rnd * 255
b = Rnd * 255
Debug.Print r, g, b
Shape1(i).BorderColor = RGB(r, g, b)
Next
Shape1(0).Move intX, intY
End Sub
注:代码随意修改一下就可以了(不要明显相同),Teacher说不能交相同的作业。