以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  日期输入框输入如何选择指定日期  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=159637)

--  作者:beifang
--  发布时间:2021/1/2 16:01:00
--  日期输入框输入如何选择指定日期
程序设计的订单补录的功能,希望使用日期输入框选择日期的时候,只能选择今天之前7天内的日期。程序该怎么写? 谢谢!!
--  作者:有点蓝
--  发布时间:2021/1/3 11:10:00
--  
日期输入框valuechanged事件

If e.Sender.Value < Date.Today.AddDays(-7) OrElse e.Sender.Value > Date.Today Then
    msgbox("只能选择今天之前7天内的日期")
    e.Sender.Value = Date.Today
End If