#include #include #include #include #Region ### START Koda GUI section ### Form=f:\cabal.kxf $Practice = GUICreate("Practice", 278, 848, 0, 7, $GUI_DOCKSIZE) GUISetBkColor(0x000000) WinSetTrans($Practice, "", 190) $Exit = GUICtrlCreateButton("Exit", 188, 8, 75, 25) $switch = GUICtrlCreateButton("Off", 8, 8, 75, 25) GUICtrlSetBkColor($switch, 0xff0000) $time = GUICtrlCreateInput("", 82, 10, 30, 21, $ES_NUMBER) $Enter = GUICtrlCreateButton("Enter", 8, 70, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Exit Exit Case $switch onOff() EndSwitch WEnd ;functions for switch Func onOff() If GUICtrlRead($switch) = 'Off' Then GUICtrlSetData($switch, 'On') GUICtrlSetBkColor($switch, 0x00ff00) $readInput = GUICtrlRead($time) If $readInput Then $readInput = $readInput * 1000 MsgBox(0, "", "You Inputed: " &$readInput) EndIf Else $try = GUICtrlSetData($switch, 'Off') GUICtrlSetBkColor($switch, 0xff0000) EndIf EndFunc