#include <GUIConstantsEx.au3> Local $counter = 0 Local $hGUI = GUICreate("Example",250,250) Local $idbutton = GUICtrlCreateButton("OK", 0, 0, 250, 250) GUISetState(@SW_SHOW, $hGUI)
While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idbutton GUICtrlSetData($idbutton,$counter) $counter+=1 EndSwitch WEnd