题库 题库

【简答题】

Private Sub Form_Load()
    Command1.Caption = "开始"
    Command2.Caption = "停止"
    Timer1.Interval = 50
    Timer1.Enabled = False
    Label1.Caption = "热烈欢迎"
    Label1.AutoSize = True
    Label1.FontSize = 16
    Label1.FontBold = True
End Sub
Private Sub Command1_Click()
    Command1.Caption = "继续"
    ' Timer1.Enabled = ?
    'Command1.Enabled = ?
    Command2.Enabled = True
End Sub
Private Sub Command2_Click()
    ' Timer1.Enabled = ?
    Command2.Enabled = False
    Command1.Enabled = True
End Sub
Private Sub Timer1_Timer()
    If Label1.Left < Width Then
        ' Label1.Left = ?
    Else
        Label1.Left = 0
    End If
End Sub

参考答案

Private Sub Form_Load()
    Command1.Caption = "开始"
    Command2.Caption = "停止"
    Timer1.Interval = 50
    Timer1.Enabled = False
    Label1.Caption = "热烈欢迎"
    Label1.AutoSize = True
    Label1.FontSize = 16
    Label1.FontBold = True
End Sub
Private Sub Command1_Click()
    Command1.Caption = "继续"
    Timer1.Enabled = True
    Command1.Enabled = False
    Command2.Enabled = True
End Sub
Private Sub Command2_Click()
    Timer1.Enabled = False
    Command2.Enabled = False
    Command1.Enabled = True
End Sub
Private Sub Timer1_Timer()
    If Label1.Left < Width Then
        Label1.Left = Label1.Left + 20
    Else
        Label1.Left = 0
    End If
End Sub

相关试题