hmsSurprise Posted April 14, 2007 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
Zedna Posted April 14, 2007 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
hmsSurprise Posted April 14, 2007 Author 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.)
DavidA Posted August 29, 2007 Posted August 29, 2007 Thank you Zedna, I am a new on AutoIT, and your solution also worked great for me!!!
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