vb中怎样才能使一个文本框里的内容随时间每隔一秒更新替换一次

2025-03-24 07:10:46
推荐回答(2个)
回答1:

Private Sub Form_Load()
Text1.Locked = True
Text1.Text = 60
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
If Val(Text1.Text) - 1 <= 0 Then
Text1.Text = 60
Else
Text1.Text = Val(Text1.Text) - 1
End If
End Sub

回答2:

在文本框的CHANGE事件中,写入注射器的刷新方法