英语翻译Dim d As BooleanPrivate Sub Form_Load()Label1.Left = Me.Width - Label1.WidthTimer1.Interval = 100d = TrueEnd SubPrivate Sub Timer1_Timer()If d ThenLabel1.Left = Label1.Left - 90ElseLabel1.Left = Label1.Left + 90End IfIf Label1.Left = Me.W
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 15:23:27
英语翻译Dim d As BooleanPrivate Sub Form_Load()Label1.Left = Me.Width - Label1.WidthTimer1.Interval = 100d = TrueEnd SubPrivate Sub Timer1_Timer()If d ThenLabel1.Left = Label1.Left - 90ElseLabel1.Left = Label1.Left + 90End IfIf Label1.Left = Me.W
英语翻译
Dim d As Boolean
Private Sub Form_Load()
Label1.Left = Me.Width - Label1.Width
Timer1.Interval = 100
d = True
End Sub
Private Sub Timer1_Timer()
If d Then
Label1.Left = Label1.Left - 90
Else
Label1.Left = Label1.Left + 90
End If
If Label1.Left = Me.Width - Label1.Width - 240 Then
d = True
End If
End Sub
英语翻译Dim d As BooleanPrivate Sub Form_Load()Label1.Left = Me.Width - Label1.WidthTimer1.Interval = 100d = TrueEnd SubPrivate Sub Timer1_Timer()If d ThenLabel1.Left = Label1.Left - 90ElseLabel1.Left = Label1.Left + 90End IfIf Label1.Left = Me.W
Dim d As Boolean '定义全局变量d,代表移动方向
Private Sub Form_Load() '程序启动时载入运行
Label1.Left = Me.Width - Label1.Width 'Label1移动到最靠窗体右边
Timer1.Interval = 100 '定时器设置为0.1秒
d = True '初始化d,方向向左
End Sub
Private Sub Timer1_Timer()
If d Then '如果d=true
Label1.Left = Label1.Left - 90 'Label1向左移动90堤
Else
Label1.Left = Label1.Left + 90 '否则Label1向右移动90堤
End If
If Label1.Left = Me.Width - Label1.Width - 240 Then '如果Label1超出窗体右边框-240堤
d = True '方向改为向左
End If
End Sub