Champak Posted May 20, 2006 Share Posted May 20, 2006 (edited) I want to be able to check a box and it checks and disables and unchecks the rest of the boxes, and when unchecked, it enables the rest of the boxes...but it wont work. I didn't use the regular if statement because it would flicker. Can I get some help? This is what I have: EDIT: What I mean by it wont work, after I check the main box, when I uncheck it, it wont enable the rest of them once they've been disabled. expandcollapse popupCase $msg = $control40 If BitAND(GUICtrlRead($control40), $GUI_CHECKED) Then GUICtrlSetState($control2, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control4, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control6, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control8, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control10, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control12, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control14, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control16, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control18, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control20, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control22, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control24, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control26, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control28, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control30, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control32, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control34, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control36, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control38, $GUI_DISABLE + $GUI_UNCHECKED) Case $msg = $control40 If BitAND(GUICtrlRead($control40), $GUI_UNCHECKED) Then GUICtrlSetState($control2, $GUI_ENABLE) GUICtrlSetState($control4, $GUI_ENABLE) GUICtrlSetState($control6, $GUI_ENABLE) GUICtrlSetState($control8, $GUI_ENABLE) GUICtrlSetState($control10, $GUI_ENABLE) GUICtrlSetState($control12, $GUI_ENABLE) GUICtrlSetState($control14, $GUI_ENABLE) GUICtrlSetState($control16, $GUI_ENABLE) GUICtrlSetState($control18, $GUI_ENABLE) GUICtrlSetState($control20, $GUI_ENABLE) GUICtrlSetState($control22, $GUI_ENABLE) GUICtrlSetState($control24, $GUI_ENABLE) GUICtrlSetState($control26, $GUI_ENABLE) GUICtrlSetState($control28, $GUI_ENABLE) GUICtrlSetState($control30, $GUI_ENABLE) GUICtrlSetState($control32, $GUI_ENABLE) GUICtrlSetState($control34, $GUI_ENABLE) GUICtrlSetState($control36, $GUI_ENABLE) GUICtrlSetState($control38, $GUI_ENABLE) Also, how do some of you get the colors to show up in the code here. Edited May 20, 2006 by Champak Link to comment Share on other sites More sharing options...
Daniel W. Posted May 20, 2006 Share Posted May 20, 2006 (edited) First the code with colors is [*autoit] ...... [/*autoit] Then expandcollapse popupDim $var = 1 Case $msg = $control40 If $var = 1 Then GUICtrlSetState($control2, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control4, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control6, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control8, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control10, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control12, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control14, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control16, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control18, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control20, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control22, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control24, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control26, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control28, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control30, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control32, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control34, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control36, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control38, $GUI_DISABLE + $GUI_UNCHECKED) $var = 0 Else GUICtrlSetState($control2, $GUI_ENABLE) GUICtrlSetState($control4, $GUI_ENABLE) GUICtrlSetState($control6, $GUI_ENABLE) GUICtrlSetState($control8, $GUI_ENABLE) GUICtrlSetState($control10, $GUI_ENABLE) GUICtrlSetState($control12, $GUI_ENABLE) GUICtrlSetState($control14, $GUI_ENABLE) GUICtrlSetState($control16, $GUI_ENABLE) GUICtrlSetState($control18, $GUI_ENABLE) GUICtrlSetState($control20, $GUI_ENABLE) GUICtrlSetState($control22, $GUI_ENABLE) GUICtrlSetState($control24, $GUI_ENABLE) GUICtrlSetState($control26, $GUI_ENABLE) GUICtrlSetState($control28, $GUI_ENABLE) GUICtrlSetState($control30, $GUI_ENABLE) GUICtrlSetState($control32, $GUI_ENABLE) GUICtrlSetState($control34, $GUI_ENABLE) GUICtrlSetState($control36, $GUI_ENABLE) GUICtrlSetState($control38, $GUI_ENABLE) $var = 1 EndIf Edited May 20, 2006 by Daniel W. --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
ChrisL Posted May 20, 2006 Share Posted May 20, 2006 [ A u t o i t ] expandcollapse popupCase $msg = $control40 If BitAND(GUICtrlRead($control40), $GUI_CHECKED) Then GUICtrlSetState($control2, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control4, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control6, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control8, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control10, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control12, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control14, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control16, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control18, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control20, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control22, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control24, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control26, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control28, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control30, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control32, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control34, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control36, $GUI_DISABLE + $GUI_UNCHECKED) GUICtrlSetState($control38, $GUI_DISABLE + $GUI_UNCHECKED) ElseIf BitAND(GUICtrlRead($control40), $GUI_UNCHECKED) Then GUICtrlSetState($control2, $GUI_ENABLE) GUICtrlSetState($control4, $GUI_ENABLE) GUICtrlSetState($control6, $GUI_ENABLE) GUICtrlSetState($control8, $GUI_ENABLE) GUICtrlSetState($control10, $GUI_ENABLE) GUICtrlSetState($control12, $GUI_ENABLE) GUICtrlSetState($control14, $GUI_ENABLE) GUICtrlSetState($control16, $GUI_ENABLE) GUICtrlSetState($control18, $GUI_ENABLE) GUICtrlSetState($control20, $GUI_ENABLE) GUICtrlSetState($control22, $GUI_ENABLE) GUICtrlSetState($control24, $GUI_ENABLE) GUICtrlSetState($control26, $GUI_ENABLE) GUICtrlSetState($control28, $GUI_ENABLE) GUICtrlSetState($control30, $GUI_ENABLE) GUICtrlSetState($control32, $GUI_ENABLE) GUICtrlSetState($control34, $GUI_ENABLE) GUICtrlSetState($control36, $GUI_ENABLE) GUICtrlSetState($control38, $GUI_ENABLE) EndIf [ / A u t o i t ] [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Daniel W. Posted May 20, 2006 Share Posted May 20, 2006 same like mine or? because you start with unchecked boxes or? --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
Champak Posted May 20, 2006 Author Share Posted May 20, 2006 (edited) Thanks to both of you, ChrisL's worked for me because I start with unchecked boxes. Would you believe, I did the "ElseIf" before I posted. However, I didn't put the EndIf on because "If" in the cases didn't have an "EndIf". :"> Can someone tell me why that is? Edited May 20, 2006 by Champak Link to comment Share on other sites More sharing options...
Daniel W. Posted May 20, 2006 Share Posted May 20, 2006 Hum i dont know what you want to say .... --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
ChrisL Posted May 20, 2006 Share Posted May 20, 2006 (edited) Thanks to both of you, ChrisL's worked for me because I start with unchecked boxes.Would you believe, I did the "ElseIf" before I posted. However, I didn't put the EndIf on because "If" in the cases didn't have an "EndIf". :"> Can someone tell me why that is?If you have an if "something" = "Something" then "do something" this doesnt require and endif as the whole if statement is on one lineIf you have several things to do or check then you use multiple lines and you need to tell it when the if statement endsIf "something = "something thenDo some stuffDo some more stuff Do even more stuffEndifThis is the same for If and Else and ElseIFIf "something" = "something" then Do some stuff Do some more stuff Do even more stuffElseif "something" = "somethingElse" then Do some different stuffEndif Edited May 20, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Champak Posted May 20, 2006 Author Share Posted May 20, 2006 OK thanks, got ya. 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