在一个窗口中有一个DateTimePicker1,此时间框的TEXTCHENGED的有代码如下:Dim jkr As String =e.Form.Controls("TextBox1").value
Dim rq As Date= e.Form.Controls("DateTimePicker1").value
Dim sbh As WinForm.TextBox = e.Form.Controls("TextBox3") '起号
Dim ebh As WinForm.TextBox = e.Form.Controls("TextBox4") '终号'
jkr = jkr.Trim(",")
Dim sx() As String = jkr.Split(",")
'显示起始号
If rq<> Date.Today
Dim qjfind As DataRow = DataTables("qjbh").Find("年='" & rq.Year & "' and 月='" & format(rq.Month,"00") & "'")
If qjfind Is Nothing '如果不存在则增加期间数据则说明是第一张
sbh.value=rq.Year & Format(rq.Month,"00") & "0001"
ebh.value=rq.Year & Format(rq.Month,"00") & Format(sx.Length,"0000")
Else 'if exsit cath bh value
sbh.value=val(qjfind("piao据号"))+1
ebh.value= val(sbh.value)+sx.Length-1
End If
End If
窗口的afterload代码如下:
e.Form.Controls("DateTimePicker1").value = Date.Today
我想让窗口初始化打开的时候不执行TEXTchenged里的代码,只是鼠标点击控件选择日期时候才执行,应该如何设置……。