代码方式:
在一个form的按钮的click事件中添加下面的代码,
----------------------start---------------------
frmCalendar = CREATEOBJECT('Form')
frmCalendar.addobject("oleCalendar","olecontrol","MSComCtl2.DTPicker.2")
frmCalendar.oleCalendar.VISIBLE=.T.
WITH frmCalendar
.autocenter = .T.
.Borderstyle = 2
.Maxbutton = .F.
.MinButton = .F.
.Height = frmCalendar.oleCalendar.Height
.width = frmCalendar.oleCalendar.width
ENDWITH
frmCalendar.show(1)
release frmCalendar
-----------------------end----------------------------