lopolop Posted August 14, 2006 Posted August 14, 2006 (edited) im having some trouble but i have a input box that i have an If Statment to check if it's Enabled but it isnt working... I also need to check if it is Disabled. If GUICtrlGetState($Input) = "$GUI_ENABLE" Then GUICtrlSetState($Input, $GUI_DISABLE) EndIf Edited August 14, 2006 by lopolop
Danny35d Posted August 14, 2006 Posted August 14, 2006 (edited) im having some trouble but i have a input box that i have an If Statment to check if it's Enabled but it isnt working... I also need to check if it is Disabled. If GUICtrlGetState($Input) = "$GUI_ENABLE" Then GUICtrlSetState($Input, $GUI_DISABLE) EndIfThe problem is the input state is actually enable and show so try this If GUICtrlGetState($Input) = $GUI_ENABLE + $GUI_SHOW then and to check if is disable try If GUICtrlGetState($Input) = $GUI_DISABLE + $GUI_SHOW then Edit: Typo Edited August 14, 2006 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Helge Posted August 14, 2006 Posted August 14, 2006 Note the use of BitAND :#include <GUIConstants.au3> GUICreate("", 100, 40) $checkbox = GUICtrlCreateCheckbox ("unchecked", 10, 10, 180, 20) GUISetState() While 1 $iMsg = GUIGetMsg() If $iMsg = $GUI_EVENT_CLOSE Then ExitLoop If $iMsg = $checkbox Then If BitAND(GUICtrlRead($checkbox), $GUI_CHECKED) Then GUICtrlSetData($checkbox, "checked") Else GUICtrlSetData($checkbox, "unchecked") EndIf EndIf WendBtw, on your first line you're trying to compare the value returned by GUICtrlGetStatewith a string. Not very important in your example anyway since your method wouldn'thave worked anyway, but keep that in mind to next time.
lopolop Posted August 14, 2006 Author Posted August 14, 2006 (edited) Works Perfectly thanks alot! [Edit] o i did see ur post when i posted Helge.. idk danny35d's way worked.. i think i may have messed something else up also tho n fixed that on accident Edited August 14, 2006 by lopolop
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