Hallo,
Ich habe derzeit ein Problem mit der Farbenwahl von meinen aktuellen kleinen Projekt.
Dies ist der Teil der am meisten Probleme macht:
Spoiler anzeigen
Func _ChooseColors()
$Form2 = GUICreate("Farben", 204, 126, 977, 237)
GUICtrlCreateLabel("Schriftfarbe:", 8, 8, 61, 17)
$Button1 = GUICtrlCreateButton("Auswählen", 128, 5, 73, 21, $WS_GROUP)
GUICtrlCreateLabel("Hintergrundfarbe:", 8, 40, 86, 17)
$Button2 = GUICtrlCreateButton("Auswählen", 128, 36, 73, 21, $WS_GROUP)
GUICtrlCreateLabel("Senderhintergrund:", 8, 72, 94, 17)
$Button3 = GUICtrlCreateButton("Auswählen", 128, 69, 73, 21, $WS_GROUP)
$Button4 = GUICtrlCreateButton("Ok", 8, 96, 35, 25, $WS_GROUP)
$Button5 = GUICtrlCreateButton("Abbrechen", 48, 96, 73, 25, $WS_GROUP)
$Button6 = GUICtrlCreateButton("Übernehmen", 128, 96, 73, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUISetState(@SW_HIDE, $Form2)
ExitLoop
Case $Button1
$Font = _ChooseColor(2)
Case $Button2
$Bg = _ChooseColor(2)
Case $Button3
$Senderbg = _ChooseColor(2)
Case $Button4
GUICtrlSetColor($Label1, $Font)
GUICtrlSetColor($Label2, $Font)
GUICtrlSetColor($Label3, $Font)
GUICtrlSetColor($Label4, $Font)
GUICtrlSetColor($Label5, $Font)
GUICtrlSetColor($Label6, $Font)
GUICtrlSetColor($Label7, $Font)
GUICtrlSetColor($Label8, $Font)
GUISetBkColor($Bg, $Form1)
GUICtrlSetBkColor($TreeView1, $Senderbg)
Case $Button5
GUISetState(@SW_HIDE, $Form2)
ExitLoop
Case $Button6
IniWrite("settings.ini", "Farben", "Schrift", $Font)
IniWrite("settings.ini", "Farben", "Schrift", $Bg)
IniWrite("settings.ini", "Farben", "Schrift", $Senderbg)
EndSwitch
WEnd
EndFunc
Problem #1: Wenn ich nicht vorher alle 3 Farben auswähle beendet sich das Programm direkt.
Problem #2: Die TreeView färbt sich nicht ein. Kann es daran liegen, dass die TreeView mit _GUICtrlTreeView_Create() erstellt wurde?
Hoffe auf schnelle Antwort.