Dalia

Button

3 posts in this topic

#1 ·  Posted

Hello guys please how i can make Start / Stop in same Button

Share this post


Link to post
Share on other sites



#2 ·  Posted

Just do a : GUICtrlCreateButton("Start",x,y)

This is the answer to the question you asked, but my guess is this isn't what you really want. :)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted

$gui = GUICreate("Start & Stop",150,250)
$btn1 = GUICtrlCreateButton("Start",60,100,50,25)
$btnExit = GUICtrlCreateButton("Exit",5,100,50,25)
$label = GUICtrlCreateLabel("",10,10,100,30)
GUISetState(@SW_SHOW)

While 1
   $Read = GUICtrlRead($btn1)
   $msg = GUIGetMsg()
   switch $msg
   Case $btnExit
      Exit
   Case $btn1
      if $Read = "Start" Then
      GUICtrlSetData($label,"Go")
       GUICtrlSetData($btn1,"Stop")
    ElseIf $Read = "Stop" Then
        GUICtrlSetData($label,"Stop")
       GUICtrlSetData($btn1,"Start")
       EndIf
   Case -3
      Exit
   EndSwitch
   WEnd

An example for your help bro...


Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now