CODICE
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$P1=8000
$P2=8000
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("LP Calculator", 440, 142, 209, 141)
GUISetBkColor(0x00FF00)
$Label1 = GUICtrlCreateLabel("First player", 16, 8, 96, 33)
GUICtrlSetFont(-1, 18, 800, 0, "Myriad Pro Cond")
GUICtrlSetColor(-1, 0xFF0000)
$Label2 = GUICtrlCreateLabel("Second player", 300, 8, 119, 33)
GUICtrlSetFont(-1, 18, 800, 0, "Myriad Pro Cond")
GUICtrlSetColor(-1, 0x0000FF)
$Button1 = GUICtrlCreateButton("+", 8, 56, 27, 25)
$Button2 = GUICtrlCreateButton("+", 285, 56, 27, 25)
$Button3 = GUICtrlCreateButton("-", 8, 92, 27, 25)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton("-", 285, 92, 27, 25)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Edit1 = GUICtrlCreateEdit("", 56, 72, 97, 25, $ES_WANTRETURN)
GUICtrlSetData(-1, $P1)
$Edit2 = GUICtrlCreateEdit("", 324, 72, 97, 25, $ES_WANTRETURN)
GUICtrlSetData(-1, $P2)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
Switch $nMsg
Case $Button1
$add1= InputBox ("AGGIUNGI","QUANTO AGGIUNGI?")
$P1= $P1+$add1
GUICtrlSetData($Edit1, $P1)
EndSwitch
Switch $nMsg
Case $Button2
$add2= InputBox ("AGGIUNGI","QUANTO AGGIUNGI?")
$P2= $P2+$add2
GUICtrlSetData($Edit2, $P2)
EndSwitch
Switch $nMsg
Case $Button3
$add1= InputBox ("SOTTRAI","QUANTO SOTTRAI?")
$P1= $P1-$add1
GUICtrlSetData($Edit1, $P1)
EndSwitch
Switch $nMsg
Case $Button4
$add2= InputBox ("SOTTRAI","QUANTO SOTTRAI?")
$P2= $P2-$add2
GUICtrlSetData($Edit2, $P2)
EndSwitch
WEnd