litlmike Posted March 6, 2006 Share Posted March 6, 2006 I am using GUICtrlCreateDate, is there way to assign text instead of a date. For example, instead of assigning "1953/04/25", is there a way to make it read, "Pick a Date", or "Pick your Starting Date"? If so, would I just modify the following code? GUICtrlCreateDate ("1953/04/25", 10,10,185,20 ) _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
BigDod Posted March 6, 2006 Share Posted March 6, 2006 Do you mean something like this #include <GUIConstants.au3> $start=InputBox ("Start Date", "Input Start Date") GUICreate ( "My GUI get date", 200,200,800,200) $date=GUICtrlCreateDate ($start, 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() Remember to input date as YYYY/MM/DD Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
litlmike Posted March 6, 2006 Author Share Posted March 6, 2006 Do you mean something like this #include <GUIConstants.au3> $start=InputBox ("Start Date", "Input Start Date") GUICreate ( "My GUI get date", 200,200,800,200) $date=GUICtrlCreateDate ($start, 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() Remember to input date as YYYY/MM/DD Thanks for the reply. Actually I was hoping to just set the GUICtrlCreateDate ("1953/04/25", 10,10,185,20 ), to read GUICtrlCreateDate ("Pick a Start Date", 10,10,185,20 ). Apparently it doesn't work that way, but I was hoping there was still a way to accomplish it. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
CyberSlug Posted March 6, 2006 Share Posted March 6, 2006 Reference: http://msdn.microsoft.com/library/default....me/datetime.aspHope this helps #include <GUIConstants.au3> $DTM_SETFORMAT = 0x1000 + 5;+50 instead of +5 for UniCode GUICreate ( "My GUI get date", 200,200,800,200) $date=GUICtrlCreateDate ("1953/04/25", 10,10,185,20 ) ;Notice the nested quotes in the next line GUICtrlSendMsg($date, $DTM_SETFORMAT ,0, "'Pick a date'") GuiSetState() While 1 $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit ElseIf $msg = $date Then;replace text with selected date GUICtrlSendMsg($date, $DTM_SETFORMAT ,0, "yyyy/mm/dd") EndIf Wend Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
litlmike Posted March 6, 2006 Author Share Posted March 6, 2006 Reference: http://msdn.microsoft.com/library/default....me/datetime.asp Hope this helps #include <GUIConstants.au3> $DTM_SETFORMAT = 0x1000 + 5;+50 instead of +5 for UniCode GUICreate ( "My GUI get date", 200,200,800,200) $date=GUICtrlCreateDate ("1953/04/25", 10,10,185,20 ) ;Notice the nested quotes in the next line GUICtrlSendMsg($date, $DTM_SETFORMAT ,0, "'Pick a date'") GuiSetState() While 1 $msg = GuiGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit ElseIf $msg = $date Then;replace text with selected date GUICtrlSendMsg($date, $DTM_SETFORMAT ,0, "yyyy/mm/dd") EndIf Wend AWESOME! Thank you! I had no idea what GUICtrlSendMsg did before now. Worked perfectly. _ArrayPermute()_ArrayUnique()Excel.au3 UDF 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