hmsSurprise Posted April 14, 2007 Share Posted April 14, 2007 The Sample GUI in the download has the following code to setup a pair of radio buttons. I would like to see an example of the standard way (AutoIt idiom) of checking which button is checked when the page is exited. Either mode would be OK. Thanks, jh ; GROUP WITH RADIO BUTTONS GuiCtrlCreateGroup("Sample Group", 230, 120) GuiCtrlCreateRadio("Radio One", 250, 140, 80) GuiCtrlSetState(-1, $GUI_CHECKED) GuiCtrlCreateRadio("Radio Two", 250, 165, 80) GUICtrlCreateGroup ("",-99,-99,1,1) ;close group Link to comment Share on other sites More sharing options...
Zedna Posted April 14, 2007 Share Posted April 14, 2007 (edited) ; GROUP WITH RADIO BUTTONS GuiCtrlCreateGroup("Sample Group", 230, 120) $radio1 = GuiCtrlCreateRadio("Radio One", 250, 140, 80) GuiCtrlSetState(-1, $GUI_CHECKED) $radio2 = GuiCtrlCreateRadio("Radio Two", 250, 165, 80) GUICtrlCreateGroup ("",-99,-99,1,1) ;close group ... If IsChecked($radio1) Then ; ... If IsChecked($radio2) Then ; ... Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc Edited April 14, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
hmsSurprise Posted April 14, 2007 Author Share Posted April 14, 2007 Perfect. Thought I had seen other code that was 'bit anding' disparate fields, but this makes perfect sense. Many thanks, jh (Sorry for tardy reply, been out sawing wood.) Link to comment Share on other sites More sharing options...
DavidA Posted August 29, 2007 Share Posted August 29, 2007 Thank you Zedna, I am a new on AutoIT, and your solution also worked great for me!!! 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