Der_Andi Posted January 30, 2007 Share Posted January 30, 2007 Hi, is there a way to change the format of those Time-Controls? I get an output like this: 00:00:00 (hour, min, sec), but seconds aren't necessary in my script. Andi Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 30, 2007 Moderators Share Posted January 30, 2007 Hi, is there a way to change the format of those Time-Controls? I get an output like this: 00:00:00 (hour, min, sec), but seconds aren't necessary in my script. Andi$Time = @HOUR & ':' & @MIN & ':' & @SEC $Time = StringTrimLeft($Time, StringInStr($Time, ':')) MsgBox(64, 'Info', $Time) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Der_Andi Posted January 30, 2007 Author Share Posted January 30, 2007 Sorry, i don't see, what you are telling me.This is what i meant:#include <GuiConstants.au3> GuiCreate("MyGUI", 392, 321,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Date_1 = GuiCtrlCreateDate("", 70, 70, 190, 20, $DTS_TIMEFORMAT) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd ExitI don't want to have these seconds in this control. Link to comment Share on other sites More sharing options...
Shevilie Posted January 30, 2007 Share Posted January 30, 2007 #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 321,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Date_1 = GuiCtrlCreateDate("", 70, 70, 190, 20, $DTS_TIMEFORMAT) ; to select a specific default format $DTM_SETFORMAT = 0x1005 $style = "HH:mm" GuiCtrlSendMsg($Date_1, $DTM_SETFORMAT, 0, $style) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit This might do the trick Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 30, 2007 Moderators Share Posted January 30, 2007 Sorry, i don't see, what you are telling me. This is what i meant: #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 321,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Date_1 = GuiCtrlCreateDate("", 70, 70, 190, 20, $DTS_TIMEFORMAT) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit I don't want to have these seconds in this control.You never said you were working with a GUI! Of course you didn't get what I said then Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Der_Andi Posted January 31, 2007 Author Share Posted January 31, 2007 You never said you were working with a GUI!Well, i thought, talking about a control would suffice. ^^ Link to comment Share on other sites More sharing options...
Der_Andi Posted January 31, 2007 Author Share Posted January 31, 2007 (edited) This might do the trickyes, it does. thank you very much. Just one more question: how do i set a custom time? GUICtrlSetData($time, "09:45") does not work... Edited January 31, 2007 by Der_Andi Link to comment Share on other sites More sharing options...
Shevilie Posted January 31, 2007 Share Posted January 31, 2007 Well you can for a start do it in the creation $Date_1 = GuiCtrlCreateDate("09:45", 70, 70, 190, 20, $DTS_TIMEFORMAT) I'll look for the GUICtrlSetData.. but read about it in the helpfile Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit 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