設窗體上有一個標簽Label 1和一個計時器Timer1,Timer1的Interval屬性被設置為1000, Enabled屬性
設窗體上有一個標簽Label 1和一個計時器Timer1,Timer1的Interval屬性被設置為1000, Enabled屬性被設置為True。要求程序運行時每秒在標簽中顯示一次系統(tǒng)當前時間。下列可以實現(xiàn)上述要求的事件過程是( )。
A. Private Sub Timer1_Timer() Labell.Caption=True End Sub
B.Private Sub Timer1_Timer() Labell.Caption=Time$ End Sub
C.Private Sub Timer1_Timer() Labell.Interval=1 End Sub
D.Private Sub Timer1_Timer() For k=1 To Timerl.Interval Label1.Caption=Timer Next K End Sub
正確答案:B解析:本題考查的考點是有關計時器的。計時器的Interval屬性決定了每隔多長時間觸發(fā)一次Timer事件。本題中Interval設置為 1000,即每1秒觸發(fā)一次Timer事件。在事件中把標簽的Caption屬性設置成為當前時間,用Time函數(shù)可以得到當前時間。
詞條內(nèi)容僅供參考,如果您需要解決具體問題
(尤其在法律、醫(yī)學等領域),建議您咨詢相關領域?qū)I(yè)人士。