Hallo TheLuBu,
das kannst du so machen:
Spoiler anzeigen
; *** Start added by AutoIt3Wrapper ***
#include <GUIConstantsEx.au3>
; *** End added by AutoIt3Wrapper ***
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Date.au3>
$Form1 = GUICreate("2 Combos",200,150)
$cbo1 = GUICtrlCreateCombo("",5,5,190)
GUICtrlSetData($cbo1,"Täglich")
GUICtrlSetData($cbo1,"Wöchentlich")
GUICtrlSetData($cbo1,"Monatlich")
$cbo2 = GUICtrlCreateCombo("",5,45,190)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]While 1
$msg = GUIGetMsg()
Switch $msg
case $Gui_Event_Close
Exit
case $cbo1
$sCbo1 = GUICtrlRead($cbo1)
Switch $scbo1
Case "Wöchentlich"
GUICtrlSetData($cbo2,"")
for $i = 1 to 7
GUICtrlSetData($cbo2,_Locale_DayName($i))
Next
case Else
GUICtrlSetData($cbo2,"")
EndSwitch
EndSwitch
WEnd
Func _Locale_MonthName($Month, $Abbrev = False)
; ==========================================================================================
; Autor: Großvater (http://www.autoit.de)
; Parameter:
; $Month - Nummer des Monats (1 - 12)
; $Abbrev - abgekürzten Namen liefern:
; |0 : nein
; |1 : ja
; ==========================================================================================
Local Const $LOCALE_USER_DEFAULT = 0x0400
Local Const $LOCALE_SMONTHNAME = 0x37
Local Const $LOCALE_LOCALE_SABBREVMONTHNAME = 0x43
Local $LCType = $LOCALE_SMONTHNAME
If $Abbrev Then $LCType = $LOCALE_LOCALE_SABBREVMONTHNAME
If Not StringIsInt($Month) Or $Month < 1 Or $Month > 12 Then Return False
Local $aResult = DllCall("Kernel32.dll", "Int", "GetLocaleInfoA", _
"UInt", $LOCALE_USER_DEFAULT, _
"UInt", $LCType + $Month, _
"Str", "", _
"Int", 255)
If @error Or $aResult[0] = 0 Then Return False
Return $aResult[3]
EndFunc
Func _Locale_DayName($WDay, $Abbrev = False)
; ==========================================================================================
; Autor: Großvater (http://www.autoit.de)
; Parameter:
; $WDay - Nummer des Wochentages (1 - 7) (!!! 1 ist Montag (s.u.) !!!)
; $Abbrev - abgekürzten Namen liefern:
; |0 : nein
; |1 : ja
; Anmerkungen:
; Zu meinem Erstaunen hat MS in WinNLS.h folgende Konstanten definiert:
; #define LOCALE_SDAYNAME1 0x0000002A // long name for Monday
; ...
; #define LOCALE_SDAYNAME7 0x00000030 // long name for Sunday
; Anders als beim Macro @WDAY gilt deshalb der Montag als Tag 1 und der Sonntag
; als Tag 7. Der passende Wert lässt sich per Aufruf der UDF-Funktion
; _DateToDayOfWeekISO()
; ermitteln.
; ==========================================================================================
Local Const $LOCALE_USER_DEFAULT = 0x0400
Local Const $LOCALE_SDAYNAME = 0x29
Local Const $LOCALE_SABBREVDAYNAME = 0x30
Local $LCType = $LOCALE_SDAYNAME
If $Abbrev Then $LCType = $LOCALE_SABBREVDAYNAME
If Not StringIsInt($WDay) Or $WDay < 1 Or $WDay > 7 Then Return False
Local $aResult = DllCall("Kernel32.dll", "Int", "GetLocaleInfoA", _
"UInt", $LOCALE_USER_DEFAULT, _
"UInt", $LCType + $WDay, _
"Str", "", _
"Int", 255)
If @error Or $aResult[0] = 0 Then Return False
Return $aResult[3]
EndFunc
die Funktion für die Wochentage ist von @Großvater
Edit: in deinem Skript ist hauptsächlich ein Tippfehler schuld:
Spoiler anzeigen
; *** Start added by AutoIt3Wrapper ***
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
; *** End added by AutoIt3Wrapper ***
#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Add_Constants=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
$Form1 = GUICreate("Neue Kampagne", 265, 393, 192, 124)
$Label1 = GUICtrlCreateLabel("Neue Kampagne Hinzufügen", 8, 8, 250, 28)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$FTPPfadNew = GUICtrlCreateInput("", 120, 56, 129, 21)
$Kampagneku = GUICtrlCreateInput("", 120, 88, 129, 21)
$SaveplaceNew = GUICtrlCreateInput("", 120, 120, 129, 21)
$Kampagnenspalte = GUICtrlCreateInput("", 120, 224, 41, 21)
$Label2 = GUICtrlCreateLabel("FTP Pfad:", 8, 56, 52, 17)
$Label3 = GUICtrlCreateLabel("Kampagnenkürzel:", 8, 88, 92, 17)
$Label4 = GUICtrlCreateLabel("Speicherort der VF", 8, 120, 92, 17)
$Label5 = GUICtrlCreateLabel("Rücklieferung", 8, 152, 70, 17)
$Label6 = GUICtrlCreateLabel("Kampagnenname", 8, 224, 87, 17)
$Label7 = GUICtrlCreateLabel("Rufnummer", 8, 248, 58, 17)
$Rufnummerspalte = GUICtrlCreateInput("", 120, 248, 41, 21)
$Kundennummerspalte = GUICtrlCreateInput("", 120, 272, 41, 21)
$Datumspalte = GUICtrlCreateInput("", 120, 296, 41, 21)
$Label8 = GUICtrlCreateLabel("Kundennummer", 8, 272, 78, 17)
$Label9 = GUICtrlCreateLabel("Datum", 8, 296, 35, 17)
$Label10 = GUICtrlCreateLabel("Spalten der Exceldatei", 8, 184, 249, 28, $SS_CENTER)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$Voicefilespalte = GUICtrlCreateInput("", 120, 320, 41, 21)
$Label11 = GUICtrlCreateLabel("Name der VF", 8, 320, 66, 17)
$Button1 = GUICtrlCreateButton("Abbrechen", 184, 352, 73, 33, $WS_GROUP)
$Button2 = GUICtrlCreateButton("OK", 184, 312, 73, 33, $WS_GROUP)
$Label12 = GUICtrlCreateLabel("Uhrzeit", 8, 344, 37, 17)
$Uhrzeitspalte = GUICtrlCreateInput("", 120, 344, 41, 21)
$Label13 = GUICtrlCreateLabel("Optin Ergebnis", 8, 368, 73, 17)
$Optinspalte = GUICtrlCreateInput("", 120, 368, 41, 21)
$Group1 = GUICtrlCreateGroup("Dateiformat", 184, 224, 73, 73)
$Radio1 = GUICtrlCreateRadio(".mp3", 192, 240, 113, 17)
$Radio2 = GUICtrlCreateRadio(".wav", 192, 264, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Combo1 = GUICtrlCreateCombo("", 88, 152, 65, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_GROUP))
GUICtrlSetData(-1, "Täglich|Wöchentlich|Monatlich", "Täglich") ;Tippfehler Wöchtenlich"
$Combo2 = GUICtrlCreateCombo("", 160, 152, 89, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_GROUP))
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Combo1 ;nur bei Änderung der Combo sonst flackert die GUI
If GUICtrlRead($Combo1) = "Täglich" Then
GUICtrlSetData($Combo2, "", "")
;GUICtrlSetData($Combo2, "", "") warum 2mal?
ElseIf GUICtrlRead($Combo1) = "Wöchentlich" Then
GUICtrlSetData($Combo2, "", "")
;GUICtrlSetData(-1, "Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|Sonntag", "Montag") ;-1 geht hier zwar aber nur weil (und solange wie) $combo2 das letzte Conrol in der GUI ist
GUICtrlSetData($Combo2, "Montag|Dienstag|Mittwoch|Donnerstag|Freitag|Samstag|Sonntag", "Montag")
ElseIf GUICtrlRead($Combo1) = "Monatlich" Then
GUICtrlSetData($Combo2, "", "")
;GUICtrlSetData($Combo2, "", "") warum 2mal?
EndIf
EndSwitch
WEnd
mfg autoBert