vb倒计时钟

回答者:彬***竒
打开VB ,在form1 上放置一下command、label1和一个timer 控件 输入以下代码 Dim ts As Integer Private Sub Command1_Click() ts = 10 Label1.Caption = 10 Timer1.Enabled = True End Sub Private Sub Timer1_Timer() ts = ts - 1 Label1.Caption = ts If ts = 0 Then Label1.Caption = "开始" Timer1.Enabled = False End If End Sub

热门头条