用VB6.0的控件shape编写一个鼠标幻影的程序
如题,用VB,一定要是6.0的,编写一个跟随着鼠标动的幻影,只能用shape控件,最好要有几个shape控件,就像XP本来鼠标加了幻影一样,但要是shape控件里的形状!...
如题,用VB,一定要是6.0的,编写一个跟随着鼠标动的幻影,只能用shape控件,最好要有几个shape控件,就像XP本来鼠标加了幻影一样,但要是shape控件里的形状!谢谢高手了
展开
2014-01-02
展开全部
在窗体上添加一个Timer控件,把Interval设为10。然后再添加一个Shape控件,形状和大小自己设置,然后复制它做成控件数组,数量随意。最后输入下面的代码。
Private intX As Integer
Private intY As IntegerPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
intX = x
intY = y
End SubPrivate 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
Private intX As Integer
Private intY As IntegerPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
intX = x
intY = y
End SubPrivate 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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询