Jump to content

Need help with simple gui

Recommended Posts

1 minute ago, dwarf said:

i am making a simple gui that changes the background color of the window when a button is pressed , but every time i press one it closes , my question is how do i get to stay open after i press a button ?

simplegui.au3 1.06 kB · 1 download

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
Global $Button1 = GUICtrlCreateButton("Red", 184, 32, 75, 25)
Global $Button2 = GUICtrlCreateButton("Green", 448, 32, 75, 25)
Global $Button3 = GUICtrlCreateButton("White", 96, 32, 75, 25)
Global $Button4 = GUICtrlCreateButton("Yellow", 360, 32, 75, 25)
Global $Button5 = GUICtrlCreateButton("Blue", 272, 32, 75, 25)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE

        Case $Button1

        Case $Button2

        Case $Button3

        Case $Button4

        Case $Button5

Func Red()
Func Blue()
Func Yellow()
Func Green()
Func White()


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...