mini Posted April 19, 2010 Share Posted April 19, 2010 (edited) Heys all... Well I've seen in some others GUI that wen we press the Yes button or the Start Button, the same button change to NO/Stop... How can i make that on my buttons!?!? BTW and if i have a "TrayCreatItem" how can i make the same on that to!! Thanks for all the replays. Edited April 22, 2010 by mini [size="4"]My first work[/size], it checks if one prograrm is running and if not it closes all necessery windows and run them again.[size="4"]My second work[/size], Script Function: It saves a Client Info and creates a INI file for all clients with all the info.[size="4"]My third work[/size], Script Function: It change some INFO on a working program, every X min configured. Link to comment Share on other sites More sharing options...
Yoriz Posted April 19, 2010 Share Posted April 19, 2010 Change the button text using GUICtrlSetData Change tray text using TrayItemSetText GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. Link to comment Share on other sites More sharing options...
mini Posted April 20, 2010 Author Share Posted April 20, 2010 (edited) Change the button text using GUICtrlSetData Change tray text using TrayItemSetText Hi again... well i've been able to change the text to STOP when i press the Start Button... But I'm missing to much code to make it back if the button is pressed again, can some one help me on it please. #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 373, 305) $Button_Start = GUICtrlCreateButton("Start", 75, 270, 50, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch GUIGetMsg() ; Check the valid events (no point in looking for Start as we are already running!) Case -3 Exit Case $Button_Start _Check4Start() EndSwitch WEnd Func _Check4Start() guictrlsetdata($Button_Start,"Stop") EndFunc ;==>_Check4Start Edited April 20, 2010 by mini [size="4"]My first work[/size], it checks if one prograrm is running and if not it closes all necessery windows and run them again.[size="4"]My second work[/size], Script Function: It saves a Client Info and creates a INI file for all clients with all the info.[size="4"]My third work[/size], Script Function: It change some INFO on a working program, every X min configured. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 20, 2010 Share Posted April 20, 2010 Here's one way to handle 2 or more "texts" pretty easy: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 373, 305) $Button_Start = GUICtrlCreateButton("Start", 75, 270, 50, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Switch GUIGetMsg() ;Having two GUIGetMsg seemed unnecessary. Case -3 Exit Case $Button_Start _Check4Start() EndSwitch WEnd Func _Check4Start() Switch GUICtrlRead($Button_Start) Case "Start" guictrlsetdata($Button_Start, "Stop") Case "Stop" GUICtrlSetData($Button_Start, "Start") EndSwitch EndFunc ;==>_Check4Start .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 20, 2010 Share Posted April 20, 2010 Track your run status with a global flag variable: #include <GUIConstantsEx.au3> Global $hForm1, $idLabel, $idButton, $f_Run = False $hForm1 = GUICreate("Form1", 300, 300) $idLabel = GUICtrlCreateLabel("We have not started...", 20, 20, 260, 20) $idButton = GUICtrlCreateButton("Start", 100, 250, 100, 30) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $idButton _Check4Start() EndSwitch WEnd Func _Check4Start() $f_Run = Not $f_Run If $f_Run Then GUICtrlSetData($idLabel, "We are running...") GUICtrlSetData($idButton, "Stop") Else GUICtrlSetData($idLabel, "We have stopped...") GUICtrlSetData($idButton, "Start") EndIf EndFunc ;==>_Check4Start Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
mini Posted April 20, 2010 Author Share Posted April 20, 2010 (edited) Thanks for your replays guys... @ AdmiralAlkex Your code is more simple, i think its better for my Gui, since I'm not a good coder. Still learning how does this all work. @ PsaltyDS I don't think i can menage to use your code on my Gui. That was just a "test run" to see how i change the text of buttons, now i need to implement them on my MAIN code, and hope i can understand (if it doesn't work) how it works. Thank you two very much for the code/help. Regards. Edited April 20, 2010 by mini [size="4"]My first work[/size], it checks if one prograrm is running and if not it closes all necessery windows and run them again.[size="4"]My second work[/size], Script Function: It saves a Client Info and creates a INI file for all clients with all the info.[size="4"]My third work[/size], Script Function: It change some INFO on a working program, every X min configured. Link to comment Share on other sites More sharing options...
mini Posted April 22, 2010 Author Share Posted April 22, 2010 Thanks guys... I let this work In pause, because i wasn't understanding how it wood work. Finally today i did it, i changed all my TryItemText and my ButtonText, and all the Func's are working perfectly. Thanks once again for your replays. [size="4"]My first work[/size], it checks if one prograrm is running and if not it closes all necessery windows and run them again.[size="4"]My second work[/size], Script Function: It saves a Client Info and creates a INI file for all clients with all the info.[size="4"]My third work[/size], Script Function: It change some INFO on a working program, every X min configured. 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