madmorgan Posted February 9, 2010 Posted February 9, 2010 hello all, im building a program were the user clicks a colour and the back ground changes colour but i cant make the $background change its colour here is my code help would be grate. thanks expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $BackGround = ("0xFFFFFF") #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form2", 232, 294, 519, 236) GUISetBkColor($BackGround) $Group1 = GUICtrlCreateGroup("Back Ground Colour", 16, 16, 185, 97) GUICtrlSetColor(-1, 0x000000) $RED = GUICtrlCreateButton("RED", 24, 40, 75, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0xFF0000) $GREEN = GUICtrlCreateButton("GREEN", 112, 40, 75, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x00FF00) $YELLOW = GUICtrlCreateButton("Yellow", 24, 72, 75, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0xFFFF00) $BLUE = GUICtrlCreateButton("Blue", 112, 72, 75, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x00FFFF) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $RED MsgBox(0,"","red") GUICtrlSetData($BackGround, 0xFF0000, 1) EndSwitch WEnd
Developers Jos Posted February 9, 2010 Developers Posted February 9, 2010 Use GUISetBkColor() as you did in the beginning of your script! SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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