设窗体上有一个标签Labell和一个计时器Timerl,Timerl的Interval属性被设置为1000, Enabled属性被设置为True。要求程序运行时每秒在标签中显示一次系统当前时间。以下可以实现上述要求的事件过程是

admin2019-06-11  30

问题 设窗体上有一个标签Labell和一个计时器Timerl,Timerl的Interval属性被设置为1000, Enabled属性被设置为True。要求程序运行时每秒在标签中显示一次系统当前时间。以下可以实现上述要求的事件过程是

选项 A、Private Sub Timer 1_Timer()
    Label 1.Caption=True
    End Sub
B、Private Sub Timer 1_Timer()
    Label 1.Caption=TimeS
    End Sub
C、Private Sub Timer 1_Timer()
    Labell.Interval=1
    End Sub
D、Private Sub Timer 1_Timer()
    For k=1 TO Timer1.Interval
    Label 1.Caption=Timer
    Next k
    End Sub

答案B

解析 本题考查的考点是有关计时器的。计时器的Interval属性决定了每隔多长时间触发一次Timer事件。本题中Interval设置为1000,即每1秒触发一次Timer事件。在事件中把标签的Caption属性设置成为当前时间,用Time函数可以得到当前时间。
转载请注明原文地址:https://kaotiyun.com/show/rVUp777K
0

最新回复(0)