vb创建一个窗体,在窗体上显示一个由右向左移动的文字循环移动,写出有关的窗体,及各控件属性及有关代码
2个回答
展开全部
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
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
回
Private Sub Timer1_Timer()
Label1.Left = Label1.Left - 100
If Label1.Left <= 0 Then Label1.Left = Form1.Width
End Sub
回
参考资料: http://zhidao.baidu.com/question/37657868.html?fr=cfnw
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询