Jump to content

GuiCtrlCreateButton


 Share

Recommended Posts

#include <GUIConstants.au3>

$Main = GUICreate("My GUI")  ; will create a dialog box that when displayed is centered
$button = GUICtrlCreateButton( "Presss here", 120, 150, 150, 20)
GUISetState (@SW_SHOW)       ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    
    If $msg = $button Then Build_GUI()
Wend
    
    
Func Build_GUI()
$gui=GUICreate("Second GUI", -1, 300, 300, 300)
GUISetState(@SW_SHOW)
EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

#include <GUIConstants.au3>

Dim $gui

$Main = GUICreate("My GUI")  ; will create a dialog box that when displayed is centered
$button = GUICtrlCreateButton( "Presss here", 120, 150, 150, 20)
GUISetState (@SW_SHOW)       ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then 
        If WinExists($gui) Then 
            GUIDelete($gui)
        Else
            Exit
        EndIf
    EndIf
    
    If $msg = $button Then Build_GUI()
Wend
    
    
Func Build_GUI()
$gui=GUICreate("Second GUI", -1, 300, 300, 300)
GUISetState(@SW_SHOW)
EndFunc

8)

NEWHeader1.png

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