BattleOfMoonShae Posted March 1, 2005 Posted March 1, 2005 Could anyone tell me what the style number would be for the GUICtrlCreateDate that would show the date in a 00/00/00 instead of 00/00/0000 and still show the calander. I went through the default -1 to 50 with no luck. Our main frame only excepts a six digit date. Thanks in advance for your time. #include <GUIConstants.au3> GUICreate("DUNNING INFORMATION", 320, 155, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018) WinSetState("DUNNING INFORMATION -", "", @SW_SHOW) $Action=GUICtrlCreateDate ("", 10, 5, 300, 20, 12 ) ; $Action = GUICtrlCreateInput("Enter The Action Date", 10, 5, 300, 20) GUICtrlSetState(-1, $GUI_ACCEPTFILES) $Dun = GUICtrlCreateInput("Enter The Dun Number", 10, 35, 300, 20) GUICtrlSetState(-1, $GUI_ACCEPTFILES) $Dollar = GUICtrlCreateInput("Enter the Dollar Amount PD", 10, 65, 300, 20) GUICtrlSetState(-1, $GUI_ACCEPTFILES) $Add = GUICtrlCreateInput("Add Extra Comment - 60 Characters Max", 10, 95, 300, 20) GUICtrlSetState(-1, $GUI_ACCEPTFILES) $btn = GUICtrlCreateButton("PROCEED", 135, 125, 60, 20) GuiCtrlSetState($btn, $GUI_DEFBUTTON) ;GUICtrlSetState(-1,$GUI_FOCUS) ; the focus is on this button GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn ExitLoop EndSelect WEnd
Holger Posted March 1, 2005 Posted March 1, 2005 (edited) Just take a look at the helpfile ...Ok, I have to say, at first I aslo didn't know where the problem could be.But please take a look (if you have WindowsXP) under the Control Panel -> Region- and Language-Options (I think) -> Advanced or something like that on the Regional Settings-tab -> Date -> Short Dateformat !Maybe this is set (by default I think) to "DD/MM/YYYY".So long...Edit: just forget:You have to change your line:$Action=GUICtrlCreateDate ("", 10, 5, 300, 20, 12)to something like:$Action=GUICtrlCreateDate ("", 10, 5, 300, 20,$DTS_SHORTDATEFORMAT) Edited March 1, 2005 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
BattleOfMoonShae Posted March 1, 2005 Author Posted March 1, 2005 Just take a look at the helpfile ...Ok, I have to say, at first I aslo didn't know where the problem could be.But please take a look (if you have WindowsXP) under the Control Panel -> Region- and Language-Options (I think) -> Advanced or something like that on the Regional Settings-tab -> Date -> Short Dateformat !Maybe this is set (by default I think) to "DD/MM/YYYY".So long...Edit: just forget:You have to change your line:$Action=GUICtrlCreateDate ("", 10, 5, 300, 20, 12)to something like:$Action=GUICtrlCreateDate ("", 10, 5, 300, 20,$DTS_SHORTDATEFORMAT)<{POST_SNAPBACK}>I tried that code already and it gives me the same date 00/00/0000 as the style 12 does. I need 00/00/00
SlimShady Posted March 1, 2005 Posted March 1, 2005 It is possible. You can change the style to anything you like.You need to send the DTM_SETFORMAT message to the date control using GUICtrlSendMsg.About the format: check the MSDN pageAbout the value of the message: search for it on Google.com .
Holger Posted March 1, 2005 Posted March 1, 2005 @SlimShady: great info So it could looks like: $DTM_SETFORMAT = 0x1005 $Action=GUICtrlCreateDate ("", 10, 5, 300, 20,$DTS_SHORTDATEFORMAT) GUICtrlSendMsg(-1,$DTM_SETFORMAT,0,"dd.MM.yy") Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
SlimShady Posted March 1, 2005 Posted March 1, 2005 I believe he wants it like this. GUICreate('New GUI') $DTM_SETFORMAT = 0x1005 $Action=GUICtrlCreateDate ("", 10, 5, 80, 20) GUICtrlSendMsg(-1,$DTM_SETFORMAT,0,"MM/dd/yy") GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then GUIDelete() EXIT EndIf WEnd
BattleOfMoonShae Posted March 1, 2005 Author Posted March 1, 2005 Thanks guys. That is exactly what I was looking for. A golden Autoit OSCAR awarded to both of you.
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