Creates a date control for the GUI.
GUICtrlCreateDate ( "text", left, top [, width [, height [, style [, exStyle]]]] )
Parameters
text | The preselected date. |
left | The left side of the control. If -1 is used then left will be computed according to GUICoordMode. |
top | The top of the control. If -1 is used then top will be computed according to GUICoordMode. |
width | [optional] The width of the control (default is the previously used width). |
height | [optional] The height of the control (default is the previously used height). |
style | [optional] Defines the style of the control. See GUI Control Styles Appendix. default (-1) : $DTS_LONGDATEFORMAT forced style : $WS_TABSTOP |
exStyle | [optional] Defines the extended style of the control. See Extended Style Table. |
Return Value
Success: | Returns the identifier (controlID) of the new control. |
Failure: | Returns 0. |
Remarks
To obtain the value of the control see GUICtrlRead.
Related
GUICoordMode (Option), GUICtrlSetState, GUIGetMsg, GUICtrlRead
Example
#include <GUIConstants.au3>
; example1
GUICreate ( "My GUI get date", 200,200,800,200)
$date=GUICtrlCreateDate ("1953/04/25", 10,10,185,20 )
GUISetState ()
; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
MsgBox(0,"Date",GUICtrlRead($date))
GUIDelete()
; example2
$DTS_TIMEFORMAT = 9
GUICreate("My GUI get time")
$n=GUICtrlCreateDate ( "", 20, 20, 100, 20, $DTS_TIMEFORMAT)
GUISetState ()
; Run the GUI until the dialog is closed
Do
$msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE
MsgBox(0,"Time", GUICtrlRead($n))