展开全部
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 1000 'timer 的触发频率是1秒
Call DetermineText()
End Sub
Private Sub DetermineText()
If TextBox1.Text = vbNullString Then
Timer1.Enabled = False 'Timer 停止
Else
Timer1.Enabled = True 'Timer 启动
End If
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Call DetermineText()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'***************此处填写你要在Time中想要执行的代码****************Start
'***************此处填写你要在Time中想要执行的代码****************End
If TextBox1.Text = vbNullString Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 1000 'timer 的触发频率是1秒
Call DetermineText()
End Sub
Private Sub DetermineText()
If TextBox1.Text = vbNullString Then
Timer1.Enabled = False 'Timer 停止
Else
Timer1.Enabled = True 'Timer 启动
End If
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Call DetermineText()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'***************此处填写你要在Time中想要执行的代码****************Start
'***************此处填写你要在Time中想要执行的代码****************End
If TextBox1.Text = vbNullString Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End Sub
End Class
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我用的是VB
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Text1_Change()
If Text1.Text <> "" Then Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Text1.Text = ""
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Text1_Change()
If Text1.Text <> "" Then Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Text1.Text = ""
Timer1.Enabled = False
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询