以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]控件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=102218)

--  作者:苏州老街
--  发布时间:2017/6/15 12:48:00
--  [求助]控件
老师,下面用红色标出的代码设置成日期控件

If Vars("YN2") = "新增"
    e.Form.Controls("TextBox1").Value = ""
    e.Form.Controls("TextBox2").Value = ""
    e.Form.Controls("DateTimePicker1").Value = ""
    e.Form.Controls("TextBox4").Value = ""
    e.Form.Controls("TextBox5").Value = ""
    e.Form.Controls("TextBox6").Value = ""
Else
    Dim Parts() As String = Vars("YN2").Split(",")
    e.Form.Controls("TextBox1").Value = Parts(0)
    e.Form.Controls("TextBox2").Value = Parts(1)
    e.Form.Controls("TextBox3").Value = Parts(2)
    e.Form.Controls("TextBox4").Value = Parts(3)
    e.Form.Controls("TextBox5").Value = Parts(4)
    e.Form.Controls("TextBox6").Value = Parts(5)
End If

--  作者:wyz20130512
--  发布时间:2017/6/15 13:30:00
--  
不明何意?
--  作者:苏州老街
--  发布时间:2017/6/15 14:07:00
--  
If e.Form.Controls("TextBox1").Value <> "" And e.Form.Controls("TextBox2").Value <> "" And e.Form.Controls("DateTimePicker1").Value <> "" And e.Form.Controls("TextBox4").Value <> "" And e.Form.Controls("TextBox5").Value <> "" And e.Form.Controls("TextBox6").Value <> ""
    Dim txt As String = e.Form.Controls("TextBox1").Value & "," & e.Form.Controls("TextBox2").Value & "," & e.Form.Controls("DateTimePicker1").Value & "," & e.Form.Controls("TextBox4").Value & "," & e.Form.Controls("TextBox5").Value & "," & e.Form.Controls("TextBox6").Value
    Functions.Execute("MailEdit","MailList.Txt",txt)
    e.Form.Close()
Else
    MessageBox.Show("信息不完整, 请重新设置! ","信息提示",MessageBoxButtons.OK)
End If


.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2017.6.12.1
错误所在事件:窗口,帐户,Button1,Click
详细错误信息:
Conversion from string "" to type \'Date\' is not valid.




--  作者:有点色
--  发布时间:2017/6/15 14:14:00
--  
If e.Form.Controls("TextBox1").Value <> "" And e.Form.Controls("TextBox2").Value <> "" And e.Form.Controls("DateTimePicker1").Text <> "" And e.Form.Controls("TextBox4").Value <> "" And e.Form.Controls("TextBox5").Value <> "" And e.Form.Controls("TextBox6").Value <> ""