Variable in Variable

  • Spoiler anzeigen
    [autoit]

    #include

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=Forms\musikfreundeplaner.kxf\Forms\musikfreundeplaner.kxf
    $Form1_1 = GUICreate("Form1", 751, 501, 293, 269)
    $Punkte = GUICtrlCreateCombo("Punkte", 8, 24, 225, 25)
    GUICtrlSetData(-1, "1 Punkte|2 Punkte|3 Punkte|4 Punkte|5 Punkte")
    $Fortschrittprogress = GUICtrlCreateProgress(0, 432, 745, 25)
    $Terminelabel = GUICtrlCreateLabel("Nächste ausstehende Termine:", 8, 176, 413, 43)
    GUICtrlSetFont(-1, 25, 400, 0, "Old English Text MT")
    $Termineliste = GUICtrlCreateList("", 8, 224, 417, 150)
    GUICtrlSetFont(-1, 12, 400, 0, "MT Extra")
    $Absagetag = GUICtrlCreateInput("", 184, 56, 49, 21)
    $Taglabel = GUICtrlCreateLabel("Absagetage vor Konzert:", 8, 56, 179, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Krankheitchkbox = GUICtrlCreateCheckbox("Krankheitchkbox", 216, 80, 17, 17)
    $Krankheitlabel = GUICtrlCreateLabel("Wegen Krankheit?", 7, 78, 135, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Konzertelabel = GUICtrlCreateLabel("Konzerte geschafft:", 8, 384, 168, 39)
    GUICtrlSetFont(-1, 20, 400, 0, "Pristina")
    $Prozentelabel = GUICtrlCreateLabel("%", 24, 464, 12, 17)
    $Stuecklabel = GUICtrlCreateLabel("Stück", 112, 464, 32, 17)
    $AusstehendeKonzert = GUICtrlCreateLabel("AusstehendeKonzert", 224, 464, 102, 17)
    $Punktebutton = GUICtrlCreateButton("Punkte", 560, 240, 177, 33, 0)
    $Listebutton = GUICtrlCreateButton("Besetzungsliste", 560, 288, 177, 33, 0)
    $Button1 = GUICtrlCreateButton("Termine ändern", 560, 336, 177, 33, 0)
    $Button2 = GUICtrlCreateButton("Button2", 560, 384, 177, 33, 0)
    $1 = GUICtrlCreateLabel(" 1", 456, 16, 17, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $2 = GUICtrlCreateLabel("2", 488, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $3 = GUICtrlCreateLabel("3", 520, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $4 = GUICtrlCreateLabel("4", 552, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $5 = GUICtrlCreateLabel("5", 584, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $6 = GUICtrlCreateLabel("6", 616, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $7 = GUICtrlCreateLabel("7", 648, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $8 = GUICtrlCreateLabel("8", 456, 48, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $9 = GUICtrlCreateLabel("9", 488, 48, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $10 = GUICtrlCreateLabel("10", 512, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $11 = GUICtrlCreateLabel("11", 544, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $12 = GUICtrlCreateLabel("12", 576, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $13 = GUICtrlCreateLabel("13", 608, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $14 = GUICtrlCreateLabel("14", 640, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $15 = GUICtrlCreateLabel("15", 448, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $16 = GUICtrlCreateLabel("16", 480, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $17 = GUICtrlCreateLabel("17", 512, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $18 = GUICtrlCreateLabel("18", 544, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $19 = GUICtrlCreateLabel("19", 576, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $20 = GUICtrlCreateLabel("20", 608, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $21 = GUICtrlCreateLabel("21", 640, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $22 = GUICtrlCreateLabel("22", 448, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $23 = GUICtrlCreateLabel("23", 480, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $24 = GUICtrlCreateLabel("24", 512, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $25 = GUICtrlCreateLabel("25", 544, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $26 = GUICtrlCreateLabel("26", 576, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $27 = GUICtrlCreateLabel("27", 608, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $28 = GUICtrlCreateLabel("28", 640, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $nextmon = GUICtrlCreateButton(">", 672, 16, 33, 25, 0)
    $prevmon = GUICtrlCreateButton("<", 408, 16, 33, 25, 0)
    $29 = GUICtrlCreateLabel("29", 448, 144, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $30 = GUICtrlCreateLabel("30", 480, 144, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $31 = GUICtrlCreateLabel("31", 512, 144, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    $mon = @MON
    $Monat = 0
    $Jahr = @YEAR
    call("Monat")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $nextmon
    $mon = $mon+1
    If $mon >12 Then
    $mon = 1
    $Jahr = $Jahr+1
    EndIf
    Call("Monat")
    Case $prevmon
    $mon = $mon-1
    If $mon <1 Then
    $mon = 12
    $Jahr = $Jahr-1
    EndIf
    Call("Monat")
    Case $Punkte
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func Monat()
    If $mon = 1 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Januar "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($30, $GUI_show)
    GUICtrlSetState($29, $GUI_show)
    GUICtrlSetState($31, $GUI_show)
    $Tage = 31
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $mon = 2 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Februar "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    $schaltjahr = $Jahr / 4
    If $schaltjahr-Round($schaltjahr,0) = 0 Then
    GUICtrlSetState($31, $GUI_Hide)
    GUICtrlSetState($30, $GUI_Hide)
    $Tage = 29
    Else
    GUICtrlSetState($31, $GUI_Hide)
    GUICtrlSetState($30, $GUI_Hide)
    GUICtrlSetState($29, $GUI_Hide)
    $Tage = 28
    EndIf
    EndIf
    If $mon = 3 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("März "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_show)
    GUICtrlSetState($30, $GUI_show)
    GUICtrlSetState($29, $GUI_show)
    $Tage = 31
    EndIf
    If $mon = 4 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("April "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_Hide)
    $Tage = 30
    EndIf
    If $mon = 5 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Mai "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_show)
    GUICtrlSetState($30, $GUI_show)
    GUICtrlSetState($29, $GUI_show)
    $Tage = 31
    EndIf
    If $mon = 6 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Juni "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_Hide)
    $Tage = 30
    EndIf
    If $mon = 7 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Juli "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_show)
    GUICtrlSetState($30, $GUI_show)
    GUICtrlSetState($29, $GUI_show)
    $Tage = 31
    EndIf
    If $mon = 8 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("August "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($30, $GUI_show)
    GUICtrlSetState($29, $GUI_show)
    $Tage = 30

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    If $mon = 9 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("September "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_Hide)
    $Tage = 30
    EndIf
    If $mon = 10 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Oktober "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_show)
    GUICtrlSetState($30, $GUI_show)
    GUICtrlSetState($29, $GUI_show)
    $Tage = 31
    EndIf
    If $mon = 11 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("November "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_Hide)
    $Tage = 30
    EndIf
    If $mon = 12 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Dezember "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($31, $GUI_show)
    GUICtrlSetState($30, $GUI_show)
    GUICtrlSetState($29, $GUI_show)
    $Tage = 31
    ;~ MsgBox(0, "Jahr", $Jahr)
    ;~ MsgBox(0, "Monat", $mon)
    For $a = 1 To $Tage Step +1
    ;~ MsgBox(0, "Tage", $a)
    If IniRead(@ScriptDir&"/MonthCal.ini", $Jahr&"|"&$mon, $Tage, "") <> "" Then
    If $a = 4 Then
    GUICtrlSetColor($4, 0xff0000)
    EndIf
    If $a = 5 Then
    GUICtrlSetColor($5, 0xff0000)
    EndIf
    If $a = 6 Then
    GUICtrlSetColor($6, 0xff0000)
    EndIf
    EndIf
    Next
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Hier der Code. Der Haken ist ganz unten, an der Stelle, wo das Label gefärbt werden soll.
    EDIT: Hab den Fehler schon gefunden, war eine Variable falsch... Aber trotzdem danke
    EDIT2: Mit number() lässt sich auch nichts machen oder? Wenn ich jetzt Number($a) ausgebe = z.B. 5 und dann das irgendwie hinter das $ setzte = $5?^^

    2 Mal editiert, zuletzt von Aquaplant (21. Dezember 2009 um 23:37)

    • Offizieller Beitrag
    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    Dim $Label[32]
    #Region ### START Koda GUI section ### Form=Forms\musikfreundeplaner.kxf\Forms\musikfreundeplaner.kxf
    $Form1_1 = GUICreate("Form1", 751, 501, 293, 269)
    $Punkte = GUICtrlCreateCombo("Punkte", 8, 24, 225, 25)
    GUICtrlSetData(-1, "1 Punkte|2 Punkte|3 Punkte|4 Punkte|5 Punkte")
    $Fortschrittprogress = GUICtrlCreateProgress(0, 432, 745, 25)
    $Terminelabel = GUICtrlCreateLabel("Nächste ausstehende Termine:", 8, 176, 413, 43)
    GUICtrlSetFont(-1, 25, 400, 0, "Old English Text MT")
    $Termineliste = GUICtrlCreateList("", 8, 224, 417, 150)
    GUICtrlSetFont(-1, 12, 400, 0, "MT Extra")
    $Absagetag = GUICtrlCreateInput("", 184, 56, 49, 21)
    $Taglabel = GUICtrlCreateLabel("Absagetage vor Konzert:", 8, 56, 179, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Krankheitchkbox = GUICtrlCreateCheckbox("Krankheitchkbox", 216, 80, 17, 17)
    $Krankheitlabel = GUICtrlCreateLabel("Wegen Krankheit?", 7, 78, 135, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Konzertelabel = GUICtrlCreateLabel("Konzerte geschafft:", 8, 384, 168, 39)
    GUICtrlSetFont(-1, 20, 400, 0, "Pristina")
    $Prozentelabel = GUICtrlCreateLabel("%", 24, 464, 12, 17)
    $Stuecklabel = GUICtrlCreateLabel("Stück", 112, 464, 32, 17)
    $AusstehendeKonzert = GUICtrlCreateLabel("AusstehendeKonzert", 224, 464, 102, 17)
    $Punktebutton = GUICtrlCreateButton("Punkte", 560, 240, 177, 33, 0)
    $Listebutton = GUICtrlCreateButton("Besetzungsliste", 560, 288, 177, 33, 0)
    $Button1 = GUICtrlCreateButton("Termine ändern", 560, 336, 177, 33, 0)
    $Button2 = GUICtrlCreateButton("Button2", 560, 384, 177, 33, 0)
    $Label[1] = GUICtrlCreateLabel(" 1", 456, 16, 17, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[2] = GUICtrlCreateLabel("2", 488, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[3] = GUICtrlCreateLabel("3", 520, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[4] = GUICtrlCreateLabel("4", 552, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[5] = GUICtrlCreateLabel("5", 584, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[6] = GUICtrlCreateLabel("6", 616, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[7] = GUICtrlCreateLabel("7", 648, 16, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[8] = GUICtrlCreateLabel("8", 456, 48, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[9] = GUICtrlCreateLabel("9", 488, 48, 13, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[10] = GUICtrlCreateLabel("10", 512, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[11] = GUICtrlCreateLabel("11", 544, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[12] = GUICtrlCreateLabel("12", 576, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[13] = GUICtrlCreateLabel("13", 608, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[14] = GUICtrlCreateLabel("14", 640, 48, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[15] = GUICtrlCreateLabel("15", 448, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[16] = GUICtrlCreateLabel("16", 480, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[17] = GUICtrlCreateLabel("17", 512, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[18] = GUICtrlCreateLabel("18", 544, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[19] = GUICtrlCreateLabel("19", 576, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[20] = GUICtrlCreateLabel("20", 608, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[21] = GUICtrlCreateLabel("21", 640, 80, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[22] = GUICtrlCreateLabel("22", 448, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[23] = GUICtrlCreateLabel("23", 480, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[24] = GUICtrlCreateLabel("24", 512, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[25] = GUICtrlCreateLabel("25", 544, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[26] = GUICtrlCreateLabel("26", 576, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[27] = GUICtrlCreateLabel("27", 608, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[28] = GUICtrlCreateLabel("28", 640, 112, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $nextmon = GUICtrlCreateButton(">", 672, 16, 33, 25, 0)
    $prevmon = GUICtrlCreateButton("<", 408, 16, 33, 25, 0)
    $Label[29] = GUICtrlCreateLabel("29", 448, 144, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[30] = GUICtrlCreateLabel("30", 480, 144, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label[31] = GUICtrlCreateLabel("31", 512, 144, 22, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    $mon = @MON
    $Monat = 0
    $Jahr = @YEAR
    call("Monat")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $nextmon
    $mon = $mon+1
    If $mon >12 Then
    $mon = 1
    $Jahr = $Jahr+1
    EndIf
    Call("Monat")
    Case $prevmon
    $mon = $mon-1
    If $mon <1 Then
    $mon = 12
    $Jahr = $Jahr-1
    EndIf
    Call("Monat")
    Case $Punkte
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func Monat()
    If $mon = 1 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Januar "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[30], $GUI_show)
    GUICtrlSetState($Label[29], $GUI_show)
    GUICtrlSetState($Label[31], $GUI_show)
    $Tage = 31
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $mon = 2 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Februar "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    $schaltjahr = $Jahr / 4
    If $schaltjahr-Round($schaltjahr,0) = 0 Then
    GUICtrlSetState($Label[31], $GUI_Hide)
    GUICtrlSetState($Label[30], $GUI_Hide)
    $Tage = 29
    Else
    GUICtrlSetState($Label[31], $GUI_Hide)
    GUICtrlSetState($Label[30], $GUI_Hide)
    GUICtrlSetState($Label[29], $GUI_Hide)
    $Tage = 28
    EndIf
    EndIf
    If $mon = 3 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("März "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_show)
    GUICtrlSetState($Label[30], $GUI_show)
    GUICtrlSetState($Label[29], $GUI_show)
    $Tage = 31
    EndIf
    If $mon = 4 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("April "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_Hide)
    $Tage = 30
    EndIf
    If $mon = 5 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Mai "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_show)
    GUICtrlSetState($Label[30], $GUI_show)
    GUICtrlSetState($Label[29], $GUI_show)
    $Tage = 31
    EndIf
    If $mon = 6 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Juni "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_Hide)
    $Tage = 30
    EndIf
    If $mon = 7 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Juli "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_show)
    GUICtrlSetState($Label[30], $GUI_show)
    GUICtrlSetState($Label[29], $GUI_show)
    $Tage = 31
    EndIf
    If $mon = 8 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("August "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[30], $GUI_show)
    GUICtrlSetState($Label[29], $GUI_show)
    $Tage = 30

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    If $mon = 9 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("September "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_Hide)
    $Tage = 30
    EndIf
    If $mon = 10 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Oktober "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_show)
    GUICtrlSetState($Label[30], $GUI_show)
    GUICtrlSetState($Label[29], $GUI_show)
    $Tage = 31
    EndIf
    If $mon = 11 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("November "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_Hide)
    $Tage = 30
    EndIf
    If $mon = 12 Then
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel("Dezember "&$Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_show)
    GUICtrlSetState($Label[31], $GUI_show)
    GUICtrlSetState($Label[30], $GUI_show)
    GUICtrlSetState($Label[29], $GUI_show)
    $Tage = 31
    ;~ MsgBox(0, "Jahr", $Jahr)
    ;~ MsgBox(0, "Monat", $mon)
    For $a = 1 To $Tage Step +1
    ;~ MsgBox(0, "Tage", $a)
    If IniRead(@ScriptDir&"/MonthCal.ini", $Jahr&"|"&$mon, $Tage, "") <> "" Then
    GUICtrlSetColor($Label[$a], 0xff0000)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    Next
    EndIf
    EndFunc

    [/autoit]

    Hier mit Array.

  • Übrigens der August hat 31 Tage ;) .
    Und ich habe mal den Code ein bisschen kürzer gemacht.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <StaticConstants.au3>
    #include <Date.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Dim $Label[32]
    #Region ### START Koda GUI section ### Form=Forms\musikfreundeplaner.kxf\Forms\musikfreundeplaner.kxf
    $Form1_1 = GUICreate("Form1", 751, 501, 293, 269)
    $Punkte = GUICtrlCreateCombo("Punkte", 8, 24, 225, 25)
    GUICtrlSetData(-1, "1 Punkte|2 Punkte|3 Punkte|4 Punkte|5 Punkte")
    $Fortschrittprogress = GUICtrlCreateProgress(0, 432, 745, 25)
    $Terminelabel = GUICtrlCreateLabel("Nächste ausstehende Termine:", 8, 176, 413, 43)
    GUICtrlSetFont(-1, 25, 400, 0, "Old English Text MT")
    $Termineliste = GUICtrlCreateList("", 8, 224, 417, 150)
    GUICtrlSetFont(-1, 12, 400, 0, "MT Extra")
    $Absagetag = GUICtrlCreateInput("", 184, 56, 49, 21)
    $Taglabel = GUICtrlCreateLabel("Absagetage vor Konzert:", 8, 56, 179, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Krankheitchkbox = GUICtrlCreateCheckbox("Krankheitchkbox", 216, 80, 17, 17)
    $Krankheitlabel = GUICtrlCreateLabel("Wegen Krankheit?", 7, 78, 135, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Konzertelabel = GUICtrlCreateLabel("Konzerte geschafft:", 8, 384, 168, 39)
    GUICtrlSetFont(-1, 20, 400, 0, "Pristina")
    $Prozentelabel = GUICtrlCreateLabel("%", 24, 464, 12, 17)
    $Stuecklabel = GUICtrlCreateLabel("Stück", 112, 464, 32, 17)
    $AusstehendeKonzert = GUICtrlCreateLabel("AusstehendeKonzert", 224, 464, 102, 17)
    $Punktebutton = GUICtrlCreateButton("Punkte", 560, 240, 177, 33, 0)
    $Listebutton = GUICtrlCreateButton("Besetzungsliste", 560, 288, 177, 33, 0)
    $Button1 = GUICtrlCreateButton("Termine ändern", 560, 336, 177, 33, 0)
    $Button2 = GUICtrlCreateButton("Button2", 560, 384, 177, 33, 0)
    $i = 1
    For $y = 16 To 144 Step 32
    For $x = 456 To 648 Step 32
    $Label[$i] = GUICtrlCreateLabel($i, $x, $y, 22, 24, $SS_RIGHT)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    If $i = 31 Then ExitLoop
    $i += 1
    Next
    Next
    $nextmon = GUICtrlCreateButton(">", 672, 16, 33, 25, 0)
    $prevmon = GUICtrlCreateButton("<", 408, 16, 33, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    $mon = @MON
    $Monat = 0
    $Jahr = @YEAR
    Monat()
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $nextmon
    $mon += 1
    If $mon > 12 Then
    $mon = 1
    $Jahr += 1
    EndIf
    Monat()
    Case $prevmon
    $mon -= 1
    If $mon < 1 Then
    $mon = 12
    $Jahr -= 1
    EndIf
    Monat()
    Case $Punkte
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func Monat()
    GUICtrlSetState($Monat, $GUI_Hide)
    $Monat = GUICtrlCreateLabel(IniRead(@ScriptDir&"/MonthCal.ini", "Monatsnamen", $mon, "")& " " & $Jahr, 255, 50)
    GUIctrlSetState($Monat, $GUI_Show)
    $Tage = IniRead(@ScriptDir&"/MonthCal.ini", "Monatstage", $mon, "")
    GUICtrlSetState($Label[29], $GUI_Hide)
    GUICtrlSetState($Label[30], $GUI_Hide)
    GUICtrlSetState($Label[31], $GUI_Hide)

    [/autoit] [autoit][/autoit] [autoit]

    If _DateIsLeapYear($Jahr) And $mon = 2 Then
    GUICtrlSetState($Label[29], $GUI_Show)
    ElseIf $Tage = 30 Then
    GUICtrlSetState($Label[29], $GUI_Show)
    GUICtrlSetState($Label[30], $GUI_Show)
    ElseIf $Tage = 31 Then
    GUICtrlSetState($Label[29], $GUI_Show)
    GUICtrlSetState($Label[30], $GUI_Show)
    GUICtrlSetState($Label[31], $GUI_Show)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $mon = 12 Then
    ; MsgBox(0, "Jahr", $Jahr)
    ; MsgBox(0, "Monat", $mon)
    For $a = 1 To $Tage Step 1
    ; MsgBox(0, "Tage", $a)
    If IniRead(@ScriptDir&"/MonthCal.ini", $Jahr&"|"&$mon, $Tage, "") <> "" Then
    GUICtrlSetColor($Label[$a], 0xff0000)
    EndIf
    Next
    EndIf
    EndFunc

    [/autoit]

    Könnte sein, dass ich noch was übersehen habe, aber dafür gibts ja die anderen Kollegen ^^ .

    Edit: Achja hier die .ini, aber als .txt, wegen Upload. Also nicht vergessen, noch umbennen in .ini.

    Edit2: @TS: Bist du dir sicher das die letzte For-Schleife, die die Labels mit Farbe füllen, nur startet im Dezember?