全部题库 / VB / 试题详情
单选题 VB
2018-02-07

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

A.Private SUb Timed_Timer(   )Labell.Caption=TrueEnd Sub
B.Private Sub Timerl_Timer(   )Labell.Caption=Time$End Sub
C.Private Sub Timerl Timer(   )labell.Interval=lEnd Sub
D.Private Sub Timed_Timer(   )For k=1 To Timerl.IntervalLabell.Caption=TimerNext k
End Sub

参考答案

B

答案解析

Timerl的Interval属性值是l000,Enabled属性为True,说明定时器开始工作,每隔1000毫秒(即1秒)触发一次Timer事件,从而执行一次Timer事件过程。要想每秒在标签中显示一次系统时间,则在Timer事件过程中把系统时间赋给标签的Caption属性就能实现。故选B。

你可能感兴趣的试题

A.Framel.Name=”框架”
B.Framel.Caption=”框架”
C.Framel.Text=”框架”
D.Framel.Value=”框架”