Jump to content

help with update a $var


Recommended Posts

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

#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
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...