sunrunner20 Posted March 1, 2009 Share Posted March 1, 2009 I need to know which one is checked(true), and GUICtrlGetState is returning the same value for all three radio controls, specifically 80. $XP = GUICtrlCreateRadio("XP", 13, 54, 50, 17) $office2k3 = GUICtrlCreateRadio("2003", 66, 54, 50, 17) $office2007 = GUICtrlCreateRadio("2007", 128, 54, 50, 17) GUICtrlSetState($office2k3, $GUI_UNCHECKED) GUICtrlSetState($office2007, $GUI_CHECKED) MsgBox(0, "", GUICtrlGetState($XP)) ; Why MsgBox(0, "", GUICtrlGetState($office2k3)) ; do these all MsgBox(0, "", GUICtrlGetState($office2007)); return 80? Link to comment Share on other sites More sharing options...
Marlo Posted March 1, 2009 Share Posted March 1, 2009 i think this should work: if BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED then ;$radio1 is checked endif Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
exodius Posted March 1, 2009 Share Posted March 1, 2009 (edited) Doing a BitAnd on it isn't really necessary... But the concept is pretty much correct: #include <GUIConstants.au3> GUICreate ("Test GUI") $XP = GUICtrlCreateRadio("XP", 13, 54, 50, 17) $office2k3 = GUICtrlCreateRadio("2003", 66, 54, 50, 17) $office2007 = GUICtrlCreateRadio("2007", 128, 54, 50, 17) GUICtrlSetState($office2k3, $GUI_UNCHECKED) GUICtrlSetState($office2007, $GUI_CHECKED) GUISetState () If GUICtrlRead ($XP) = $GUI_CHECKED Then MsgBox(0, "Checked", GUICtrlGetState($XP)) Else MsgBox(0, "UnChecked", GUICtrlGetState($XP)) EndIf If GUICtrlRead ($office2k3) = $GUI_CHECKED Then MsgBox(0, "Checked", GUICtrlGetState($office2k3)) Else MsgBox(0, "UnChecked", GUICtrlGetState($office2k3)) EndIf If GUICtrlRead ($office2007) = $GUI_CHECKED Then MsgBox(0, "Checked", GUICtrlGetState($office2007)) Else MsgBox(0, "UnChecked", GUICtrlGetState($office2007)) EndIf Edited March 1, 2009 by exodius 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