Hello,
I'm trying to make a simple GUI that when a button is pressed a second GUI appears. In the second GUI (that also has a button) if I click the button I see a message. That is all.
I really don't know what is wrong with my very simple script. The problem is that when the second GUI appears, it is unresponsive. I click the button and nothing...
The little code is below.
Could you help me?
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
Opt("GUIOnEventMode", 1)
$MainGUI = GUICreate("Main", 190, 49, 570, 115)
GUISetOnEvent($GUI_EVENT_CLOSE, "End")
$MainButton = GUICtrlCreateButton("Main OK", 12, 12, 75, 25)
GUICtrlSetOnEvent($MainButton, "CreateSecondGUI")
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func CreateSecondGUI()
$SecondGUI = GUICreate("Second", 190, 49, 570, 215)
GUISetOnEvent($GUI_EVENT_CLOSE, "End")
$SecondButton = GUICtrlCreateButton("Second OK", 12, 12, 75, 25)
GUICtrlSetOnEvent($SecondButton, "OK")
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
EndFunc
Func OK()
MsgBox(0, "", "Child OK pressed")
EndFunc
Func End()
MsgBox(0, "", "The End")
Exit
EndFunc