Jump to content

Words instead of Date for GUICtrlCreateDate


Recommended Posts

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

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

Reference: http://msdn.microsoft.com/library/default....me/datetime.asp

Hope this helps :o

#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

Reference: http://msdn.microsoft.com/library/default....me/datetime.asp

Hope this helps :o

#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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...