以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]时间段选择,本月1日到最后一天  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=56808)

--  作者:lijin951
--  发布时间:2014/9/12 16:54:00
--  [求助]时间段选择,本月1日到最后一天
我要做个时间段的选择,最后效果是在打开窗口后 开始时间默认为本年本月的第一天       结束时间默认为本年本月的最后一天 ,如何在窗口加载事件中写代码啊
我用了类似代码
Dim a As Date = Date.Today
Dim y As Date = a.Year
Dim m As Date = a.Month
但是这是返回的字符型啊

--  作者:有点甜
--  发布时间:2014/9/12 16:55:00
--  

  参考

 

http://www.foxtable.com/help/topics/2720.htm

 


--  作者:有点甜
--  发布时间:2014/9/12 16:56:00
--  
Dim y As Integer = Date.Today.Year
Dim m As Integer = Date.Today.Month
Dim dt1 As New Date(y, m, 1)
Dim dt2 As New Date(y, m, Date.DaysInMonth(y,m)) \'获取该月的最后一天