Jump to content

Recommended Posts

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
Link to post
Share on other sites

Just take a look at the helpfile :lmao: ...

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 by Holger
Link to post
Share on other sites

Just take a look at the helpfile :lmao: ...

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
Link to post
Share on other sites

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
Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...