3个回答
展开全部
窗体上添加一个命令按钮,一个计时器,一个标签,然后加入如下代码,点运行
Private Sub Command1_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Label1.Caption = "欢迎使用"
Label1.FontSize = 20
Label1.ForeColor = vbBlue
Label1.AutoSize = True
Label1.Left = -Label1.Width
Label1.Top = (Form1.ScaleHeight - Label1.Height) / 3
Timer1.Interval = 10
Timer1.Enabled = True
Command1.Caption = "停止"
Command1.Move Form1.ScaleWidth - 1000, Form1.ScaleHeight - 600, 800, 400
End Sub
Private Sub Timer1_Timer()
Label1.Move Label1.Left + 30
If Label1.Left > Form1.ScaleWidth Then Label1.Left = -Label1.Width
End Sub
Private Sub Command1_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Label1.Caption = "欢迎使用"
Label1.FontSize = 20
Label1.ForeColor = vbBlue
Label1.AutoSize = True
Label1.Left = -Label1.Width
Label1.Top = (Form1.ScaleHeight - Label1.Height) / 3
Timer1.Interval = 10
Timer1.Enabled = True
Command1.Caption = "停止"
Command1.Move Form1.ScaleWidth - 1000, Form1.ScaleHeight - 600, 800, 400
End Sub
Private Sub Timer1_Timer()
Label1.Move Label1.Left + 30
If Label1.Left > Form1.ScaleWidth Then Label1.Left = -Label1.Width
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Static a As Integer
a = Label1.Width
b = Label1.Left
If Command1.Caption = "开始" Then
Command1.Caption = "停止"
Timer1.Enabled = True
Timer1.Interval = 50
b = -a
Else
Timer1.Enabled = False
Command1.Caption = "开始"
End If
End Sub
Private Sub Form_Load()
Label1.Left = -Label1.Width
End Sub
Private Sub Timer1_Timer()
Label1.Left = Label1.Left + 50
If Label1.Left > Me.Width Then Label1.Left = -Label1.Width
End Sub
Static a As Integer
a = Label1.Width
b = Label1.Left
If Command1.Caption = "开始" Then
Command1.Caption = "停止"
Timer1.Enabled = True
Timer1.Interval = 50
b = -a
Else
Timer1.Enabled = False
Command1.Caption = "开始"
End If
End Sub
Private Sub Form_Load()
Label1.Left = -Label1.Width
End Sub
Private Sub Timer1_Timer()
Label1.Left = Label1.Left + 50
If Label1.Left > Me.Width Then Label1.Left = -Label1.Width
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用Label1写欢迎词,加一个Timer1,Interval属性设成10
加一个Command1
Private Sub Command1_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Label1.Left = -Label1.Width
End Sub
Private Sub Timer1_Timer()
Label1.Left = Label1.Left + 10
If Label1.Left >= Me.Width Then Label1.Left = -Label1.Width
End Sub
加一个Command1
Private Sub Command1_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Label1.Left = -Label1.Width
End Sub
Private Sub Timer1_Timer()
Label1.Left = Label1.Left + 10
If Label1.Left >= Me.Width Then Label1.Left = -Label1.Width
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询