vb中利用timer控制标签左右循环移动
发布网友
发布时间:2022-05-06 02:47
我来回答
共5个回答
热心网友
时间:2022-06-28 13:19
Dim
Step
As
Integer
Private
Sub
Form_Load()
Step
=
200
End
Sub
Private
Sub
Timer1_Timer()
If
lblshow.Left
>=
Me.ScaleWidth
Then
Step
=
-200
If
lblshow.Left
<=
0
Then
Step
=
200
lblshow.Left
=
lblshow.Left
+
Step
End
Sub
热心网友
时间:2022-06-28 13:19
直接每过一定长度的时间就把控件的坐标变一下就行了
比如说
Lable1.Left=Lable1.Left-100
热心网友
时间:2022-06-28 13:20
Dim FX As Integer '方向
Private Sub Form_Load()
Timer1.Interval = 100
Timer1.Enabled = True
FX = 1
End Sub
Private Sub Timer1_Timer()
If Label1.Left < 0 Then FX = 1 '正方向
If Label1.Left > Me.Width Then FX = -1 '反方向
Label1.Left = Label1.Left + (200 * FX)
End Sub
热心网友
时间:2022-06-28 13:20
Dim Step As Integer
Private Sub Form_Load()
Step = 200
End Sub
Private Sub Timer1_Timer()
If lblshow.Left >= Me.ScaleWidth Then Step = -200
If lblshow.Left <= 0 Then Step = 200
lblshow.Left = lblshow.Left + Step
End Sub
热心网友
时间:2022-06-28 13:21
什么意思请写清楚些。