Sign in to follow this  
Followers 0
Terrified

GuiCtrlCreateButton

6 posts in this topic

Hi im new here so dont laugh at me ;)

i want to make a button and after ill click on him it will open me a new gui window.

how can i do that :P?

Share this post


Link to post
Share on other sites



#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

Share this post


Link to post
Share on other sites

ty its work :P

but i dont want it to close both gui window when i click exit button, so what should i do?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

ty :P btw wich progreminng language used at autoit?

Share this post


Link to post
Share on other sites

ty :P btw wich progreminng language used at autoit?

C++

8)


NEWHeader1.png

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  
Followers 0