vladedoty Posted July 14, 2009 Share Posted July 14, 2009 (edited) here is my variablesnow I want the input boxes and labels to be "grayed out" (disabled) if the checkbox is unchecked and enabled if checked.$chkUseProgram = GUICtrlCreateCheckbox("Program", 20, 35, 110, 17) $lblBasic = GUICtrlCreateLabel("Basic Options:", 20, 57, 80, 17) GUICtrlSetColor(-1, 0xff0000) $lblProgramPath = GUICtrlCreateLabel("Exe path:", 50, 74, 80, 17) $txtProgramPath = GUICtrlCreateInput("", 105, 71, 129, 19) $cmdProgramPath = GUICtrlCreateButton("...", 238, 71, 20, 19) $lblProfile = GUICtrlCreateLabel(" Profile to load:", 25, 96, 80, 17) $txtProfile = GUICtrlCreateInput("", 105, 94, 129, 19) $cmdProfile = GUICtrlCreateButton("...", 238, 94, 20, 19) $lblBatchPath = GUICtrlCreateLabel("Batch path:", 39, 119, 80, 17) $txtBatchPath = GUICtrlCreateInput("", 105, 117, 129, 19) $cmdSelectBatchPath = GUICtrlCreateButton("...", 238, 117, 20, 19) Edited July 14, 2009 by vladedoty Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 14, 2009 Share Posted July 14, 2009 You can use a For-loop: expandcollapse popup#include <GUIConstantsEx.au3> GUICreate("Test", 320, 320) $chkUseProgram = GUICtrlCreateCheckbox("Program", 20, 35, 110, 17) $lblBasic = GUICtrlCreateLabel("Basic Options:", 20, 57, 80, 17) GUICtrlSetColor(-1, 0xff0000) $lblProgramPath = GUICtrlCreateLabel("Exe path:", 50, 74, 80, 17) $txtProgramPath = GUICtrlCreateInput("", 105, 71, 129, 19) $cmdProgramPath = GUICtrlCreateButton("...", 238, 71, 20, 19) $lblProfile = GUICtrlCreateLabel(" Profile to load:", 25, 96, 80, 17) $txtProfile = GUICtrlCreateInput("", 105, 94, 129, 19) $cmdProfile = GUICtrlCreateButton("...", 238, 94, 20, 19) $lblBatchPath = GUICtrlCreateLabel("Batch path:", 39, 119, 80, 17) $txtBatchPath = GUICtrlCreateInput("", 105, 117, 129, 19) $cmdSelectBatchPath = GUICtrlCreateButton("...", 238, 117, 20, 19) For $X = $lblProgramPath To $cmdSelectBatchPath GUICtrlSetState($X, $GUI_DISABLE) Next GUISetState() While 1 Switch GUIGetMsg() Case $chkUseProgram If BitAnd(GUICtrlRead($chkUseProgram),$GUI_CHECKED) Then For $X = $lblProgramPath To $cmdSelectBatchPath GUICtrlSetState($X, $GUI_ENABLE) Next Else For $X = $lblProgramPath To $cmdSelectBatchPath GUICtrlSetState($X, $GUI_DISABLE) Next EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Vivek221 1 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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