Hi, im trying to set a certain button to load up as disabled. The problem is that i cant get the "Button" to be disabled accordingly to the Ini file.
heres a simple code to help you understand what im trying to do.
#include <GUIConstants.au3>
$Form = GUICreate("Testing", 150, 66, 400, 308)
$Button1 = GUICtrlCreateButton("1", 16, 16, 49, 33, 0)
$Button2 = GUICtrlCreateButton("2", 85, 15, 49, 33, 0)
GUISetState(@SW_SHOW)
If IniRead(@ScriptDir&"\Settings.Ini", "General", "LoadList", "") <> "" Then
GUICtrlSetState("$Button"&IniRead(@ScriptDir&"\Settings.Ini", "General", "LoadList", ""), $GUI_DISABLE)
Else
GUICtrlSetState($Button1, $GUI_DISABLE)
IniWrite(@ScriptDir&"\Settings.Ini", "General", "LoadList", "1")
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetState($Button1, $GUI_DISABLE)
GUICtrlSetState($Button2, $GUI_ENABLE)
IniWrite(@ScriptDir&"\Settings.Ini", "General", "LoadList", "1")
Case $Button2
GUICtrlSetState($Button1, $GUI_ENABLE)
GUICtrlSetState($Button2, $GUI_DISABLE)
IniWrite(@ScriptDir&"\Settings.Ini", "General", "LoadList", "2")
EndSwitch
WEnd