要怎么在VB的界面上加左右移动的文字?
1个回答
展开全部
用一个Label和Timer控件:
Private Sub Form_Load()
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
Static r As Boolean
If Not r Then
If Label1.Left + Label1.Width < Me.ScaleWidth Then Label1.Left = Label1.Left + 50 Else r = True
Else
If Label1.Left > 0 Then Label1.Left = Label1.Left - 50 Else r = False
End If
End Sub
Private Sub Form_Load()
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
Static r As Boolean
If Not r Then
If Label1.Left + Label1.Width < Me.ScaleWidth Then Label1.Left = Label1.Left + 50 Else r = True
Else
If Label1.Left > 0 Then Label1.Left = Label1.Left - 50 Else r = False
End If
End Sub
追问
Label和Timer控件要怎么放呢?
追答
随便放
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询