Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Multiple Gui's and Buttons

$
0
0
Hi there,


I'm aware this might of been answered multiple times, however I'm not able to figure it out by myself, even read the WIKI about Managing Multiple Gui's but it didn't help at all...

So, I have a main GUI which calls this second GUI, asking if the user wants to start the application or not. If the user chooses "No" the second GUI is deleted and there's only the Main GUI visible.
The problem is whenever the second GUI is deleted the buttons on the Main GUI stop working.

Here is the part of the code I'm talking about:
[ autoit ]         
; BEGIN MainGUI $Form1 = GUICreate("MainGUI", 600, 450 ) $Button1 = GUICtrlCreateButton("Start", 0, 0, 0, 0, 0) ; Obviously these are not the right coordinates... $Button2 = GUICtrlCreateButton("Exit", 0, 0, 0, 0, 0) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 Form2() Case $Button2 Exit EndSwitch WEnd ; END MainGUI ; BEGIN GUI2 Func Form2() $Form2 = GUICreate("GUI2", 0, 0, -1, -1, -1) $Label1 = GUICtrlCreateLabel("Would you like to start the application?", 0, 0, 0, 0) $Button1 = GUICtrlCreateButton("Yes", 0, 0, 0, 0, $WS_GROUP) $Button2 = GUICtrlCreateButton("No", 0, 0, 0, 0, $WS_GROUP) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 GUIDelete(); ShellExecuteWait(@ScriptDir & $EXE_Path) Case $Button2 GUIDelete(); EndSwitch WEnd EndFunc ; END GUI2

Any help, please?


Thanks in advance!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>