窗口的AfterLoad事件:
Dm t As Date = Date.Today
t = t.AddHours(Date.Now.Hour)
e.Form.Controls("控件名").Value = t
当然设置窗口的时候,还得设置控件的日期时间格式,否则时间不会显示: