BryonR 0 Report post 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 Share this post Link to post Share on other sites
Valuater 107 Report post 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) Share this post Link to post Share on other sites
BryonR 0 Report post Posted November 7, 2008 I want to know if the box is checked or not. The output is actully going to a dabase. Thanks! Share this post Link to post Share on other sites
BryonR 0 Report post 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 Share this post Link to post Share on other sites
Valuater 107 Report post 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 Share this post Link to post Share on other sites