qixx Posted August 17, 2009 Posted August 17, 2009 Hi, I don't understand how I could use a Checkbox. If the Checkbox is true, $var2 should be: $var2=1 If the CheckBox ist false, $var2 schould be: $var2=0 $CheckBox1 = GUICtrlCreateCheckbox ( "Check", 170, 90) Sry for my english, but I'm german.>_< Thank you!
Phaser Posted August 17, 2009 Posted August 17, 2009 (edited) I was doing this yesterday and found this if BitAnd(GUICtrlRead($checkbox), $GUI_CHECKED) = True Then ExitLoop EndIf The exitloop bit is obviousley for my script, put what you need in there HTH Edited August 17, 2009 by Phaser
somdcomputerguy Posted August 17, 2009 Posted August 17, 2009 Use this way to check.. If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Phaser Posted August 17, 2009 Posted August 17, 2009 Use this way to check.. If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then Hi Bruce I tried that way yesterday and didnt get any result, the way I posted above does work as I thought it would, your way seemd to NOT work for me?
somdcomputerguy Posted August 17, 2009 Posted August 17, 2009 @Phaser - I copied and pasted that line right out of one of my working scripts. I don't know why it wouldn't be working for you.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
qixx Posted August 17, 2009 Author Posted August 17, 2009 If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then $var2=1 Else $var2=0 Endif Right? MfG qixx
somdcomputerguy Posted August 17, 2009 Posted August 17, 2009 Looks right to me.. And if it does work, it probably is right.. >_ - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Genos Posted August 17, 2009 Posted August 17, 2009 I copy/pasted that, and it works for me. #include <GUIConstantsEx.au3> GUICreate("My GUI Button") $check = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20) $Button_1 = GUICtrlCreateButton("Display Value", 10, 30, 100) GUISetState() While 1 $msg = GUIGetMsg() if $msg = $Button_1 then POPUP() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Func POPUP() If GUICtrlRead($check) = $GUI_CHECKED Then $var2=1 Else $var2=0 Endif msgbox(0,"Yep",$var2) EndFunc that's just slopped together, but if you click the button with the box unchecked, you will get 0, with it checked you will get 1
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