窗口AfterLoad事件代码 Dim d As Date = Today Dim d1 As Date = New Date(d.Year,d.Month,1) '第一天 Dim d2 As Date = New Date(d.Year,d.Month,Date.DaysInMonth(d.Year,d.Month)) '最后一天 e.Form.Controls("DateTimePicker1").Value = d1 e.Form.Controls("DateTimePicker2").Value = d2