Jump to content
Sign in to follow this  
UQOII

Change automaticaly the gui background

Recommended Posts

UQOII

This little script change the background of GUI automatic

Not very useful but it is funny

#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 by UQOII

[center]uqoii.nl[/center]

Share this post


Link to post
Share on other sites
Andreik

Your UDF is very interesting and very useful.

You may set your favourite color as GUI background.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
UQOII

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]

Share this post


Link to post
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
Sign in to follow this  

×