Private Sub Picture2_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If X + Label3.Width <= Picture2(0).Width Then
Label3.Left = X
Else
Label3.Left = X - Label3.Width
End If
end sub
当Label3抵达左侧告缺或右侧野伏时,将自动翻转颂友携位置,而不会超出界外而看不见。
Dimr,
l,
s
As
Boolean
Private
Sub
Form_Load()
s
=
True
l
=
False
r
=
False
End
Sub
Private
Sub
Timer1_Timer()
If
Image1.Left
<=
0
Or
r
=
True
Then
Image1.Left
=
Image1.Left
+
100
l
=
False
r
=
True
End
If
If
Form1.Width
-
Image1.Width
<=
Image1.Left
Or
l
=
True
Then
Image1.Left
=
Image1.Left
-
100
r
=
False
l
=
True
End
If
If
(Image1.Left
<>
0
Or
Form1.Width
-
Image1.Width
<=
Image1.Left)
And
s
=
True
Then
Image1.Left
=
Image1.Left
+
100
l
=
False
r
=
True
s
=
False
End
If
End
Sub
我调唯李试过可达到你的雀闷要求
我在窗口上添顷山弯加了image控件
和timer控件
timer1.interval=1
image1.stretch=true
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)