#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include ;_____________________________________________________________ Opt("GUIOnEventMode", 1) ; Change to OnEvent mode Opt("GUICloseOnESC", 0) ;1=ESC closes, 0=ESC won't close ;__________________________________________________________ Global $maingui = GUICreate("myCalculator",500,400,-1,-1) Global $bcalc = GUICtrlCreateButton("CALCULATE",360,200,100,30) Global $input1 = GUICtrlCreateInput("",180,50,80,22) Global $iRead1 = GUICtrlRead($input1) GUICtrlSetOnEvent($bcalc,"myfunction") GUISetOnEvent($GUI_EVENT_CLOSE,"sclose") GUISetState(@SW_SHOW) While 1 Sleep(100) ; Sleep to reduce CPU usage WEnd ;_______________________________________________ func sclose() Exit EndFunc Func myfunction() MsgBox(0,"",$iRead1) EndFunc