1,451
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Sub Command1_Click()
' 这里显示的是格式化为指定格式的日期,注意format函数和customformat属性的月份大小写是有区别的;
MsgBox Format(DTPicker1.Value, "yyyy-mm-dd")
End Sub
Private Sub Form_Load()
' 下边的是显示在控件中的格式;
DTPicker1.CustomFormat = "yyyy-MM-dd"
DTPicker1.Format = dtpCustom ' 使用自定义格式;
End Sub