以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  DateTimePicker  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=97422)

--  作者:longyanlin
--  发布时间:2017/3/12 7:59:00
--  DateTimePicker

请教打开窗口后DateTimePicker1如何默认为本月的第一天,谢谢!


--  作者:wyz20130512
--  发布时间:2017/3/12 13:00:00
--  
Dim dtp As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
Dim t As Date = Date.Today()
Dim y,m As Integer
y = t.Year()
m = t.Month()
Dim t2 As New Date(y,m,1)
dtp.Value = t2