Jump to content

Change automaticaly the gui background


UQOII
 Share

Recommended Posts

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]

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...