Sign in to follow this  
Followers 0
Imbuter2000

how to change a date in a calendar created by GUICtrlCreateMonthCal

3 posts in this topic

How can I change in a script the date selected in a calendar created by GUICtrlCreateMonthCal?

I have two calendars that I use for setting a FROM and a TO date and I want to automatically copy the FROM date to the TO date when the user click on a FROM date... (and not viceversa)

Share this post


Link to post
Share on other sites



Boom :huh2:

#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 484, 186, 264, 186)
$MonthCal1 = GUICtrlCreateMonthCal("2011/06/15", 8, 8, 229, 164, -1, 0)
$MonthCal2 = GUICtrlCreateMonthCal("2011/06/15", 248, 8, 229, 164, -1, 0)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $MonthCal1
            GUICtrlSetData($MonthCal2, GUICtrlRead($MonthCal1))
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

Great! thanks!

In my tests I tried to use GUICtrlSetData with "06/06/2011" and it didn't work because the correct data format to set it is "2011/06/06"! :huh2:

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