jercfd Posted October 11, 2008 Share Posted October 11, 2008 How can I use GUICtrlSetDefColor to set the color of all my controls after the controls have been created. I tried to change the color after the controls are created but I still can't. I really don't want to use GUICtrlSetColor on each control because I have a lot of controls in multiple GUIs. Link to comment Share on other sites More sharing options...
ResNullius Posted October 12, 2008 Share Posted October 12, 2008 How can I use GUICtrlSetDefColor to set the color of all my controls after the controls have been created. I tried to change the color after the controls are created but I still can't. I really don't want to use GUICtrlSetColor on each control because I have a lot of controls in multiple GUIs.If you won't set the DefColor before you create the controls, then you can still use GuiCtrlSetColor without having to specify each control. Just make your first and last controls dummy controls on each Gui and then run a loop to change the color: GUICreate("test") $StartCtrl = GUICtrlCreateDummy() GUICtrlCreateLabel("Label", 5, 5) GUICtrlCreateButton("Button", 5, 20, 50) GUICtrlCreateEdit("Edit", 5, 50, 200, 100) $EndCtrl = GUICtrlCreateDummy() $btnChange = GUICtrlCreateButton("Change control colors", 25, 300) GUISetState() $ColorDef = True While 1 $msg = GUIGetMsg() Switch $msg Case - 3 Exit Case $btnChange If $ColorDef Then $Color = 0xFF0000 Else $Color = 0x000000 EndIf For $i = $StartCtrl To $EndCtrl GUICtrlSetColor($i, $Color) Next $ColorDef = Not $ColorDef EndSwitch WEnd Link to comment Share on other sites More sharing options...
jercfd Posted October 12, 2008 Author Share Posted October 12, 2008 Thanks. It works great. 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