BryonR Posted November 7, 2008 Share Posted November 7, 2008 (edited) I'm trying for something like $result= GuiCtrlRead ($checkBox),$GUI_CHECKED then "checked" else "uncheck" MsgBox(48, "test", $result, 3) Check boxes are far from my stong point, any help would be welcomed. -Bryon Edited November 10, 2008 by BryonR Link to comment Share on other sites More sharing options...
Valuater Posted November 7, 2008 Share Posted November 7, 2008 Like this.... $result = _IsChecked($checkBox) Then MsgBox(48, "test", $result, 3) Func _IsChecked($control) Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked 8) Link to comment Share on other sites More sharing options...
BryonR Posted November 7, 2008 Author Share Posted November 7, 2008 I want to know if the box is checked or not. The output is actully going to a dabase. Thanks! Link to comment Share on other sites More sharing options...
BryonR Posted November 7, 2008 Author Share Posted November 7, 2008 Thank you... #include <GUIConstants.au3> GUICreate("My GUICtrlRead"); will create a dialog box that when displayed is centered $menu1 = GUICtrlCreateMenu("File") $n1 = GUICtrlCreateCheckbox("Alpha", 10, 10,80) $n2 = GUICtrlCreateButton("Read", 10, 100, 50) GUICtrlSetState(-1, $GUI_FOCUS); the focus is on this button GUISetState (); will display an empty dialog box ; Run the GUI until the dialog is closed Do $msg = GUIGetMsg() if $msg = $n2 Then $n1state = GUICtrlRead($n1); return the state of $n1 If $n1state = $GUI_CHECKED Then MsgBox(4096,"",GUICtrlRead($n1,1) & " is checked") If $n1state = $GUI_UNCHECKED Then MsgBox(4096,"",GUICtrlRead($n1,1) & " is unchecked") EndIf Until $msg = $GUI_EVENT_CLOSE Link to comment Share on other sites More sharing options...
Valuater Posted November 7, 2008 Share Posted November 7, 2008 (edited) #include <GUIConstants.au3> GUICreate("My GUICtrlRead"); will create a dialog box that when displayed is centered $menu1 = GUICtrlCreateMenu("File") $n1 = GUICtrlCreateCheckbox("Alpha", 10, 10, 80) $n2 = GUICtrlCreateButton("Read", 10, 100, 50) GUICtrlSetState(-1, $GUI_FOCUS); the focus is on this button GUISetState(); will display an empty dialog box ; Run the GUI until the dialog is closed Do $msg = GUIGetMsg() If $msg = $n2 Then If _IsChecked($n1) Then MsgBox(4096, "", GUICtrlRead($n1, 1) & " is checked") ; FileWrite($File, "checked") Else MsgBox(4096, "", GUICtrlRead($n1, 1) & " is unchecked") ; FileWrite($File, "unchecked") EndIf EndIf Until $msg = $GUI_EVENT_CLOSE Func _IsChecked($control) Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked 8) Edited November 7, 2008 by Valuater 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