Sign in to follow this  
Followers 0
sunrunner20

Help with code

3 posts in this topic

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?

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 by exodius

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0