本帖最后由 shqf 于 2014-9-23 13:13 编辑
楼主试试以下代码,XP系统中效果还可以。我用了二个input,一个button,模拟date控件。按了button,才显示真正的date控件。选择日期后代码会将日期数值读到input中并show input。button中的小三角还需要再搞一下。#include <ButtonConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 306, 184, 402, 166)
$Input1 = GUICtrlCreateInput("", 72, 40, 122, 21)
$Input2 = GUICtrlCreateInput("", 190, 40, 17, 21)
GUICtrlSetState(-1,$GUI_DISABLE)
$Button1 = GUICtrlCreateButton("v", 190, 42, 15, 18,$WS_EX_CLIENTEDGE)
$Date1 = GUICtrlCreateDate("2014/09/23 12:17:15", 72, 40, 135, 22)
GUICtrlSetState(-1,$GUI_HIDE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetState($Input1,$GUI_HIDE)
GUICtrlSetState($Input2,$GUI_HIDE)
GUICtrlSetState($Button1,$GUI_HIDE)
GUICtrlSetState($Date1,$GUI_SHOW)
MouseClick ("left", default,Default)
Case $date1
GUICtrlSetData($Input1,GUICtrlRead($Date1))
GUICtrlSetState($Input1,$GUI_SHOW)
GUICtrlSetState($Input2,$GUI_SHOW)
GUICtrlSetState($Button1,$GUI_SHOW)
GUICtrlSetState($Date1,$GUI_HIDE)
EndSwitch
WEnd
|