Silas Posted August 10, 2018 Posted August 10, 2018 Hello everyone, I have a radio button ($Radio1), which I want to disable as soon as another one get's checked (Radio5). (The system fails if the radio button i'm troubling with also gets checked). I know how to disable him: If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio5), $GUI_DISABLE) Then GUICtrlSetState($Radio5, 128) But if i try to enable $Radio5 again, after $Radio1 isn't checked anymore, it fails: If GUICtrlRead($Radio1)=Not 1 And Not BitAND(GUICtrlGetState($Radio5), $GUI_ENABLE) Then GUICtrlSetState($Radio5, 64) Anyone knows why?
AutoBert Posted August 10, 2018 Posted August 10, 2018 Try this way: If BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) And BitAND(GUICtrlGetState($Radio5), $GUI_ENABLE) Then GUICtrlSetState($Radio5, 128)
mikell Posted August 11, 2018 Posted August 11, 2018 16 hours ago, Silas said: If GUICtrlRead($Radio1)=Not 1 Wrong syntax. "Not 1" means "false" Should be : If GUICtrlRead($Radio1)=4 (unchecked) or If GUICtrlRead($Radio1)<>1
Silas Posted August 11, 2018 Author Posted August 11, 2018 Thank you guys. The answer from Mikell solved my problem. It works smoothly when I use this: If GUICtrlRead($Radio1)<>1 And Not BitAND(GUICtrlGetState($Radio5), $GUI_ENABLE) Then GUICtrlSetState($Radio5, 64)
jdelaney Posted August 11, 2018 Posted August 11, 2018 Just a heads up, you can also use these: ControlDisable ControlEnable IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Zedna Posted August 12, 2018 Posted August 12, 2018 Look here: https://www.autoitscript.com/wiki/Snippets_(_Checkboxes_)#IsChecked Resources UDF ResourcesEx UDF AutoIt Forum Search
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