Jump to content
Sign in to follow this  
KillingEye

How to close window with button?

Recommended Posts

KillingEye

Hi,

here is my part of a script:

$Loginchild = GUICreate("Login", 200, 100)
                GUISetState(@SW_SHOW)
                GUICtrlCreateLabel("Account:", 10, 10)
                $loginname = GUICtrlCreateInput("", 62, 10, 65, 18)
                GUICtrlCreateLabel("Password:", 10, 40)
                $PW = GuiCtrlCreateInput("", 62, 40, 65, 18)
                $loginsend = GUICtrlCreateButton("OK!", 20, 70, 35)
                $cancellogin = GUICtrlCreateButton("Cancel", 70, 70, 50)


            Case $msg = $loginsend
                iniwrite("server.ini", "Login", "Name", guictrlread($loginname))
                iniwrite("server.ini", "Login", "PW", guictrlread($PW))
            ;GuiDelete($Loginchild) <-- 

            Case $msg = $cancellogin
                GUIDelete($Loginchild)

If you click on the OK! Button the Childwindow should close, it does not work.

Share this post


Link to post
Share on other sites
Valuater

Maybee...

$Loginchild = GUICreate("Login", 200, 100)
GUICtrlCreateLabel("Account:", 10, 10)
$loginname = GUICtrlCreateInput("", 62, 10, 65, 18)
GUICtrlCreateLabel("Password:", 10, 40)
$PW = GUICtrlCreateInput("", 62, 40, 65, 18)
$loginsend = GUICtrlCreateButton("OK!", 20, 70, 35)
$cancellogin = GUICtrlCreateButton("Cancel", 70, 70, 50)
GUISetState(@SW_SHOW)

While 1
 $msg = GUIGetMsg()
 
 Select
  Case $msg = $loginsend
   ;IniWrite("server.ini", "Login", "Name", GUICtrlRead($loginname))
   ;IniWrite("server.ini", "Login", "PW", GUICtrlRead($PW))
   GuiDelete($Loginchild) ;<--
   ExitLoop
   
  Case $msg = $cancellogin
   GUIDelete($Loginchild)
   ExitLoop
 EndSelect
 
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Valuater

Just tested again and it works for me... I just commented out the iniwrite stuff.

I do not know how this is utilized in your complete Script

8)

EDIT: If you are "re-using" this child GUI, you should "Hide" and "Show" the GUI instead of deleting it

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
KillingEye

your solution does not work in my script...

sry^^

But i found a solution for this Problem :)

Ty for your help anyway! :)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.