UQOII Posted May 5, 2008 Posted May 5, 2008 (edited) This little script change the background of GUI automatic Not very useful but it is funny expandcollapse popup#include <GUIConstants.au3> $COLOR = 22000 $colorbtn = 28000 $n = 0 $count = 500 GUICreate("My GUI") $btn = GUICtrlCreateButton("Start",10,10,50) $btn2 = GUICtrlCreateButton("Stop",60,10,50) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $btn Then AdlibEnable("CHANGECOLOR",200) If $msg = $btn2 Then AdlibDisable() Wend Func CHANGECOLOR() If $color = 28000 Then $n = 1 ElseIf $color = 22000 Then $n = 0 EndIf If $n = 0 Then $color = $color + $count $colorbtn = $colorbtn - $count GUICtrlSetBkColor($btn,$colorbtn) GUICtrlSetBkColor($btn2,$colorbtn) GUISetBkColor($color) ConsoleWrite("gui " & $color & " - button " & $colorbtn& @LF) ElseIf $n = 1 Then $color = $color - $count $colorbtn = $colorbtn + $count GUICtrlSetBkColor($btn,$colorbtn) GUICtrlSetBkColor($btn2,$colorbtn) GUISetBkColor($color) ConsoleWrite("gui " & $color & " - button " & $colorbtn& @LF) EndIf EndFunc Edited May 8, 2008 by UQOII [center]uqoii.nl[/center]
Andreik Posted May 5, 2008 Posted May 5, 2008 Your UDF is very interesting and very useful. You may set your favourite color as GUI background.
UQOII Posted May 8, 2008 Author Posted May 8, 2008 edit in 1st post the buttons are also change. - if the gui backgroundcolor = 28000 then is the button 22000 (see consolewrite) [center]uqoii.nl[/center]
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