Jump to content

Read state of group radio buttons


Recommended Posts

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

; 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 by Zedna
Link to comment
Share on other sites

  • 4 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...