#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiDateTimePicker.au3>
#include<date.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 353, 130, 399, 230)
$Date1 = GUICtrlCreateDate("", 80, 24, 186, 21, BitOR($DTS_UPDOWN, $DTS_TIMEFORMAT, $WS_TABSTOP))
_GUICtrlDTP_SetFormat(GUICtrlGetHandle($Date1), "HH:mm:ss")
;GUICtrlSetData($Date1, $D)
$Date2 = GUICtrlCreateDate("2012/07/16 13:56:3", 80, 80, 186, 21, BitOR($DTS_UPDOWN, $DTS_TIMEFORMAT, $WS_TABSTOP))
_GUICtrlDTP_SetFormat(GUICtrlGetHandle($Date2), "HH:mm:ss")
GUICtrlSetState($Date2, $GUI_DISABLE)
;GUICtrlSetData($Date2, _DateAdd('h', 4,_NowCalcDate()))
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Date1
$D2 = _DateAdd('h', 4, _NowCalcDate() & ' ' & GUICtrlRead($Date1))
GUICtrlSetData($Date2, $D2)
EndSwitch
WEnd 这样就可以满足要求了。。。嘻嘻 |