修改VB制作鼠标跟随显踪迹
答案:1 悬赏:70 手机版
解决时间 2021-04-24 15:43
- 提问者网友:练爱
- 2021-04-23 19:30
Private intX As Integer
Private intY As Integer
Private Sub Form_Load()
Shape1(0) = 3
Shape1(1) = 3
Shape1(2) = 3
Shape1(3) = 3
Shape1(4) = 3
End Sub
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
For i = 4 To 1 Step -1
Shape1(i).Move Shape1(i - 1).Left, Shape1(i - 1).Top
Next
Shape1(0).Move intX, intY
End Sub 此代码是5个shape控件和一个时钟控件请把5个shape控件修改为 运行时边框的颜色随机变换。
最佳答案
- 五星知识达人网友:傲气稳了全场
- 2021-04-23 21:06
Private intX As Integer
Private intY As Integer
Private Sub Form_Load()
Shape1(0) = 3
Shape1(1) = 3
Shape1(2) = 3
Shape1(3) = 3
Shape1(4) = 3
End Sub
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
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯