There is something wrong with this forum...
Everything is continually freezing.
Here's my attempt, hope you learn best by example:
Opt("GUIOnEventMode",1)
Global $guiMain, $labelInstalled[5], $buttonInstall[5]
$guiMain = GUICreate("Application GUI",345,150)
GUICtrlCreateLabel("Notepad",5,5,100,20)
GUICtrlCreateLabel("App 2",5,35,100,20)
GUICtrlCreateLabel("App 3",5,65,100,20)
GUICtrlCreateLabel("App 4",5,95,100,20)
GUICtrlCreateLabel("App 5",5,125,100,20)
For $z = 0 To 4
$labelInstalled[$z] = GUICtrlCreateLabel("Installed",120,5 + 30 * $z,100,20)
GUICtrlSetColor(-1,0x00FF00)
$buttonInstall[$z] = GUICtrlCreateButton("Remove",240,5 + 30 * $z,100,20)
GUICtrlSetOnEvent(-1,"InstallApp")
Next
GUISetOnEvent(-3,"Quit")
GUISetState()
While 1
Sleep(25)
WEnd
Func InstallApp()
Local $index = (@GUI_CtrlId - $buttonInstall[0])/2
If GUICtrlRead($labelInstalled[$index]) = "Installed" Then
GUICtrlSetData($labelInstalled[$index],"Not Installed")
GUICtrlSetColor($labelInstalled[$index],0xFF0000)
GUICtrlSetData($buttonInstall[$index],"Install")
Else
GUICtrlSetData($labelInstalled[$index],"Installed")
GUICtrlSetColor($labelInstalled[$index],0x00FF00)
GUICtrlSetData($buttonInstall[$index],"Remove")
EndIf
EndFunc
Func Quit()
Exit
EndFunc