Tagor Posted April 16, 2005 Posted April 16, 2005 Is it possible to run something if a radiobutton is being selected?
TuMbLeWeEd Posted April 16, 2005 Posted April 16, 2005 Is it possible to run something if a radiobutton is being selected?<{POST_SNAPBACK}>Sure, why not! Just dig tru the helpfile, and look at the example codes (works for me) My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers
Tagor Posted April 16, 2005 Author Posted April 16, 2005 That's not what I was looking for. I would like to run something when the bullet is clicked.
eJan Posted April 16, 2005 Posted April 16, 2005 Run Notepad when 2nd radio clicked:#include <GuiConstants.au3>GuiCreate("", 100, 60)$radio0 = GuiCtrlCreateRadio("None", 0, 0, 100) $radio1 = GuiCtrlCreateRadio("Run Notepad", 0, 20, 100)GuiSetState()While 1 $msg = GuiGetMsg() Select case $msg = $radio1 Run("Notepad") Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelectWEnd
Tagor Posted April 16, 2005 Author Posted April 16, 2005 Weird, then I don't get why this doesn't work: Instead of Run("Notepad"): GuiSetState ($radio0, $WS_ENABLE)
TuMbLeWeEd Posted April 16, 2005 Posted April 16, 2005 (edited) Weird, then I don't get why this doesn't work:Instead of Run("Notepad"):GuiSetState ($radio0, $WS_ENABLE)<{POST_SNAPBACK}>Why you want to do that ? The control IS enabled!And it should be GuiCtrlSetState ($radio0, $GUI_ENABLE)Maybe if you explain wat you want to do we can help you! Edited April 16, 2005 by TuMbLeWeEd My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers
eJan Posted April 16, 2005 Posted April 16, 2005 Then try: GuiCtrlSetState($radio0, $GUI_ENABLE) or GuiCtrlSetState($radio0, $GUI_CHECKED) (to work on it...).
Tagor Posted April 16, 2005 Author Posted April 16, 2005 Sorry for not being clear. I want to make the following thing; all radiobuttons are enabled, if someone selects one of the radiobuttons, a submit button should become enabled to submit the values of the radiobuttons.
steveR Posted April 17, 2005 Posted April 17, 2005 That function is handled better by a checkbox AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
JSThePatriot Posted April 17, 2005 Posted April 17, 2005 Sorry for not being clear. I want to make the following thing; all radiobuttons are enabled, if someone selects one of the radiobuttons, a submit button should become enabled to submit the values of the radiobuttons.<{POST_SNAPBACK}>This is very easy to do. I am trying to look for some old code that I had that will do this. Save me the time of having to rethink everything and type it again hehe.Give me a few and hopefully we will get this resolved.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
megahyperion Posted April 17, 2005 Posted April 17, 2005 #include <GUIConstants.au3> GUICreate("My GUI radio") $radio1 = GUICtrlCreateRadio ("Radio 1", 10, 10, 120, 20) $exit = GUICtrlCreateButton ("exit", 10, 40, 120, 20) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $exit Then exit endif If GUICtrlRead($radio1) = 1 Then MsgBox(4096, "Test", "tadaa") sleep(2000) Exit endif Wend I had to add the sleep(2000) and Exit in there so the box could actually be closed. Without it the msgbox couldnt be closed because the loop was still seeing the button checked. FYI radio button checked =1 Not checked =3 when using guiread
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