Sign in to follow this  
Followers 0
litlmike

Words instead of Date for GUICtrlCreateDate

5 posts in this topic

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 )

Share this post


Link to post
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



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


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
Sign in to follow this  
Followers 0