[ HELP ]Start button

12/04/2014 14:14 nhoklipice#1
hi everyone, sr about my english.
i used KODA Form and creat two button start / stop, but how i can create only one button START, when i click START, it turn to STOP and run the scripts, and click STOP, it stop the scritp and turn to START.
Thx very much !
12/04/2014 15:10 lolkop#2
Quote:
Originally Posted by nhoklipice View Post
hi everyone, sr about my english.
i used KODA Form and creat two button start / stop, but how i can create only one button START, when i click START, it turn to STOP and run the scripts, and click STOP, it stop the scritp and turn to START.
Thx very much !
Code:
Dim $run, $textBtn[2] = ["Start","Stop"]
GUICreate("GUI", 150, 100, Default, Default, 0x10C80000)
$btn = GUICtrlCreateButton($textBtn[$run], 10, 10, 130, 80)
Do
	$msg = GUIGetMsg()
	If $msg = $btn Then
		$run = Not $run
		GUICtrlSetData($btn, $textBtn[$run])
	EndIf
	If $run Then
		;<actions>
	EndIf
Until $msg=-3
12/04/2014 15:16 nhoklipice#3
this code it start, but can't stop !