vb编写一个程序

来源:百度知道 编辑:UC知道 时间:2024/05/15 06:05:34
VB编写一个如下要求的程序

write a program to move the label left side to right side automatically(use Timer Control)
那这个怎么做啊?

write a program to enter any number and check it,is it positve,negative or zero(using procedure and inputbox)

Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 200
End Sub

Private Sub Timer1_Timer()
Static IsMove As Boolean
If Label1.Left < Me.Width + Label1.Width And IsMove = False Then
Label1.Left = Label1.Left + Me.Width / 20
Else
If IsMove = False Then IsMove = True
If Label1.Left > -Label1.Width Then
Label1.Left = Label1.Left - Me.Width / 20
ElseIf IsMove Then IsMove = False
End If
End If
'左右来回移动
End Sub

=====================

Private Sub Form_Load()
Dim a
a = InputBox("")
If a > 0 Then
MsgBox "Positive"
Else
If a = 0 Then MsgBox "Zero" Else MsgBox "Negative"
End If
End Sub

Private Sub Form_Load()

Me.Label1.Left = 0

Me.Timer1.Interval = 10

End Sub

Private Sub Timer1_Timer()
I