Hi all
My problem is that I have no way to work with buttons in a while loop
When i run the form i can exit well clicking a close main window and olso if i click in a exit button but if i start the apllication whith a Start button execute a loop for view a random numbers and then i can't stop the rogram and i can't not exit with a Exit button.
I think the problem is in the use of events but i can not find the solution....
Thank's to all
The exemple is this:
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
Opt("GUIOnEventMode", 1)
$random_numbers = GUICreate("Random numbers",351,171,-1,-1,-1,-1)
GUISetOnEvent($GUI_EVENT_CLOSE, "close")
$lavel_number = GUICtrlCreateLabel("",117,36,98,26,BitOr($SS_CENTER,$SS_CENTERIMAGE),$WS_EX_STATICEDGE)
GUICtrlSetBkColor(-1,"0xFFFFFF")
$start = GUICtrlCreateButton("Start",34,95,100,30,-1,-1)
GUICtrlSetOnEvent(-1,"start")
$stop = GUICtrlCreateButton("Pause",182,95,100,30,-1,-1)
GUICtrlSetOnEvent(-1,"pause")
$exit = GUICtrlCreateButton("Exit",112,136,100,30,-1,-1)
GUICtrlSetOnEvent(-1,"close")
GUISetState(@SW_SHOW)
While 1
Sleep (50)
Wend
Func start()
While 1
Sleep(100)
Local $a = Random(1,10,1)
GUICtrlSetData($lavel_number,$a)
WEnd
EndFunc
Func pause()
EndFunc
func close()
exit
EndFunc