Das geht so:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <DateTimeConstants.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <Date.au3>
#include <File.au3>
Const $DTM_SETFORMAT_ = 0x1032
Const $DATUMSFORMAT = "MMMM,dddd, dd.MM.yyyy"
$akt_datum = @YEAR & "/" & @MON & "/" & @WDAY;
$folderDelim = "\"
$xDelim = "-"
$Form1 = GUICreate("Datumwechsel", 233, 170, 52, 702,-1, 0x00000018)
$Date1 = GUICtrlCreateDate($akt_datum, 10, 45, 200, 21)
GUICtrlSendMsg($Date1, $DTM_SETFORMAT_, 0, $DATUMSFORMAT)
$Date2 = GUICtrlCreateDate($akt_datum, 10, 90, 200, 21)
GUICtrlSendMsg($Date2, $DTM_SETFORMAT_, 0, $DATUMSFORMAT)
$Checkbox1 = GUICtrlCreateCheckbox("Automatisch Datum2 einstellen", 10, 117, 200, 19,$BS_AUTOCHECKBOX)
GuiCtrlSetState(-1, $GUI_CHECKED)
GUISetState(@SW_SHOW, $Form1)
While True
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $Date1
_datumChange()
Case $Date2
EndSwitch
WEnd
Func _datumChange()
If Not BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) Then Return
Local $date = StringRight(GUICtrlRead($Date1), 10)
$date = _DateAdd('D', -1, StringRight($date,4) & '/' & StringMid($date,4,2) & '/' & StringLeft($date,2))
GUICtrlSetData($Date2, $date)
EndFunc