Borje Posted March 10, 2009 Share Posted March 10, 2009 (edited) Hi everybody I need some help I cant get the ok button to work, what I want is when I start a script this gui is displayed until I press the OK button after Ok button is pressed I want the script to continue. What I needed to do? $GUI = GuiCreate("Button test" &" When OK is pressed I want continue the script " ,565,170,-1,-1,0x7) GUISetState (@SW_SHOW) GUICtrlCreateLabel(" Button test when press OK ",1,17,560) $font="Verdana" GUICtrlSetFont (-1,11,500,3,$Font) guiCtrlSetColor(-1, 0x0000ff) GUICtrlCreateButton("OK", 200, 60, 100, 20) Sleep(5000) Edited March 10, 2009 by Borje Link to comment Share on other sites More sharing options...
GEOSoft Posted March 10, 2009 Share Posted March 10, 2009 Something like this but you will have to play with it. Actually you NEED to read the help file. ; $font="Verdana" $GUI = GuiCreate("Button test" &" When OK is pressed I want continue the script " ,565,170,-1,-1,0x7) GUICtrlCreateLabel(" Button test when press OK ",1,17,560) GUICtrlSetFont (-1,11,500,3,$Font) guiCtrlSetColor(-1, 0x0000ff) $Btn_Go = GUICtrlCreateButton("OK", 200, 60, 100, 20) GUISetState (@SW_SHOW);; Preferably after the controls are created Do Sleep(50) Until GUIGetMsg() = $Btn_Go GUIDelete($Gui) ; George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Zedna Posted March 10, 2009 Share Posted March 10, 2009 #include <GUIConstantsEx.au3> $GUI = GuiCreate("Button test" &" When OK is pressed I want continue the script " ,565,170,-1,-1,0x7) GUICtrlCreateLabel(" Button test when press OK ",1,17,560) $font="Verdana" GUICtrlSetFont (-1,11,500,3,$Font) guiCtrlSetColor(-1, 0x0000ff) $ok = GUICtrlCreateButton("OK", 200, 60, 100, 20) GUISetState (@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ; close app on Esc Case $ok ExitLoop ; close form and execute desired code at the end EndSwitch WEnd GUIDelete($GUI) ; here place your code to be executed after OK MsgBox(0,'Info','Test') Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Borje Posted March 10, 2009 Author Share Posted March 10, 2009 Thankyou Geosoft I would try this Link to comment Share on other sites More sharing options...
Borje Posted March 10, 2009 Author Share Posted March 10, 2009 Thank you Zedna I try yours too Link to comment Share on other sites More sharing options...
GEOSoft Posted March 10, 2009 Share Posted March 10, 2009 Zedna gave you a good example but you still NEED to read the help file. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
jpm Posted March 10, 2009 Share Posted March 10, 2009 Hi everybodyI need some help I cant get the ok button to work, what I want is when I start a script this gui is displayed until I press the OK buttonafter Ok button is pressed I want the script to continue.What I needed to do? $GUI = GuiCreate("Button test" &" When OK is pressed I want continue the script " ,565,170,-1,-1,0x7) GUISetState (@SW_SHOW) GUICtrlCreateLabel(" Button test when press OK ",1,17,560) $font="Verdana" GUICtrlSetFont (-1,11,500,3,$Font) guiCtrlSetColor(-1, 0x0000ff) GUICtrlCreateButton("OK", 200, 60, 100, 20) Sleep(5000)Just read the GUICtrlCreateButton doc example and do the same. at least try to understand how to get info from a gui Link to comment Share on other sites More sharing options...
Borje Posted March 10, 2009 Author Share Posted March 10, 2009 Thanks all of you for the help. It is working now 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