vb创建一个窗体,在窗体上显示一个由右向左移动的文字循环移动,写出有关的窗体,及各控件属性及有关代码

来源:百度知道 编辑:UC知道 时间:2024/05/14 10:01:52
跪求~~~~~~~~~~~~~~~~~~

Private Sub Command1_Click()
If Command1.Caption = "开始" Then
Command1.Caption = "停止"
Else
Command1.Caption = "开始"
End If
Timer1.Enabled = Not Timer1.Enabled
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 10
Command1.Caption = "开始"
Label1.Caption = ""
Label1.AutoSize = True
End Sub

Private Sub Timer1_Timer()
Label1.Caption = Time
Label1.Left = Label1.Left - 10
If Label1.Left + Label1.Width <= 0 Then Label1.Left = Me.Width
End Sub

加个 timer interval=100
Private Sub Timer1_Timer()
Label1.Left = Label1.Left - 100
If Label1.Left <= 0 Then Label1.Left = Form1.Width
End Sub