Jump to content

If button pressed


3dude
 Share

Recommended Posts

here's a full examlpe about making GUI and Buttons

#include <GUIConstants.au3>

$main_GUI = GUICreate ("Main GUI", 200 , 100,-1,-1,$WS_POPUPWINDOW + $WS_THICKFRAME)
$b_1 = GUICtrlCreateButton("Show Child GUI", 10, 20,120, 30)
$x = GUICtrlCreateButton("Exit", 10, 60,120, 30)
GUISetState(@SW_SHOW, $main_GUI)
$a = WinGetPos ($main_GUI)
$child_GUI = GUICreate("Child GUI",200,100,$a[0] + 210 , $a[1],$WS_POPUPWINDOW + $WS_THICKFRAME)
GUICtrlCreateLabel("This is the Child GUI", 50, 30,120, 30)
$b_2 = GUICtrlCreateButton("Close Child GUI", 40, 60,120, 30)
GUISetState(@SW_HIDE, $child_GUI)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $x
            Exit
        Case $msg = $b_1
            GUISetState (@SW_SHOW, $child_GUI)
            GUICtrlSetState ($b_1 , $gui_disable)
        Case $msg = $b_2
            GUISetState (@SW_HIDE, $child_GUI)
            GUICtrlSetState ($b_1 , $gui_enable)
    EndSelect
WEnd

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

Ahhh That's fantastic!! Thanks a lot! It contains answers to many of my questions!

Thanks a lot

you're welcome but I recommend u to search the forum u'll see alot of amazing members examples

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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