As far as I know GuiClose label is an inbuilt label which is associated with close button for any Gui window. NOW, suppose i have codes for two guis in same script and i want that when i press close button for first gui then it should show msgbox saying you pressed close button for first gui. And if i press close button for second gui then it should pop up that you pressed close button for second gui.
My codes are these-
Code: Select all
1::
Gui Add, Edit, x165 y47 w181 h67
Gui Add, Button, x168 y153 w177 h55, &OK
Gui Show, w456 h320, First Gui
Return
GuiClose:
MsgBox you pressed close button for first gui
return
2::
Gui r:Add, Edit, x165 y47 w181 h67
Gui r:Add, Button, x168 y153 w177 h55, &OK
Gui r:Show, w456 h320, Second Gui
Return
GuiClose: ; Here it is showing error that- Duplicate Label
MsgBox you pressed close button for second gui
return
In the above codes you can see that i have two different guis. First gui is shown when i press 1 key and second gui is shown when i press 2 key. But here the problem is I want that when i press the close button of first gui then it should show the msgbox you pressed close button for first gui and when i press the close button of second gui then it should show the msgbox you pressed close button for second gui. But these codes are producing error of Duplicate label. This script is accepting only one GuiClose Lable which can be associated with only one gui.
Please help and guide to solve my problem.
Thanks a lot..