TheBreeder Posted April 6, 2010 Share Posted April 6, 2010 I try to put a predefined value in the time input field with the GUICtrlSetData($TimeControl,"12:16:20") and I dont receive the correct time in the field. I receive 15:24:54 in the input field. #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GuiConstantsEx.au3> #include <GuiDateTimePicker.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $hDTP ,$k ; Create GUI GUICreate("DateTimePick Set Format", 400, 300) $k=GUICtrlCreateDate("12:15:26", 2, 6, 190) $hDTP = GUICtrlGetHandle($k) GUISetState() ; Set the display format _GUICtrlDTP_SetFormat($hDTP, "HH:mm:ss") ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Elke vogel zingt zoals hij gebekt is !Als alleen die vogels zongen die het mooiste zingen zou het stil zijn in het bos. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 6, 2010 Moderators Share Posted April 6, 2010 Richardr,As far as I know, you can only choose the date to be shown in a Date control - the time always comes up as your system time. You can alter this once the control is created using the $DTS_UPDOWN style to replace the dropdown calendar with an up/down control, but I can find no way to alter the displayed time directly - other than by messing with the system time itself. GUICtrlSetData only seems to work with the date in the "yyyy/mm/dd" format - as stated in the Help file.Sorry I cannot be of more help - perhaps someone else might have the answer. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
TheBreeder Posted April 7, 2010 Author Share Posted April 7, 2010 In the GUICtrlCreateDate, i specified the format style $DTS_TIMEFORMAT. This gives me the right format and the UP/down buttons. When playing aroudn with the control, i added the date in the text field ans then the time is displayed correctly. The final coding is GuiCtrlSetData($guitime,"2010/01/01 " & $vartime). This gives the correct display and returns the updated time when using $vartime=GuiCtrlRead($guitime) thanks for your research Richard Elke vogel zingt zoals hij gebekt is !Als alleen die vogels zongen die het mooiste zingen zou het stil zijn in het bos. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 7, 2010 Moderators Share Posted April 7, 2010 Richardr,Well done! As the Help file only mentioned date, I never thought to try with a date/time mix. One to add to my snippets store. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now