Ian_Mac Posted June 18, 2017 Share Posted June 18, 2017 hi, i'm newbie and i would like to ask for help. can someone please help me how can i make the button detect on or of if clicked, . i did attached my script thanks. test.au3 Link to comment Share on other sites More sharing options...
benners Posted June 18, 2017 Share Posted June 18, 2017 This changes the text to on or off on each click. If you want stuff to run just add it in the "if then else" part #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #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) $On = GUICtrlCreateButton("On", 8, 8, 75, 25) GUICtrlSetBkColor($On, 0xffff00) GUICtrlCreateInput("", 82, 10, 30, 21) $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 $On If GUICtrlRead($On) = 'On' Then GUICtrlSetData($On, 'Off') Else GUICtrlSetData($On, 'On') EndIf EndSwitch WEnd Ian_Mac 1 Link to comment Share on other sites More sharing options...
Ian_Mac Posted June 18, 2017 Author Share Posted June 18, 2017 thank you man that helps me a lot. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now