effer Posted December 29, 2005 Share Posted December 29, 2005 I have a script, which creates a window with login and password input. When you click the OK button, the values from the inputs must be saved in variables, and then close the window. I can't get the button to close the window, when you click it. How do I do that? The part of the script which creates the windows looks like this: $loginwindow = GUICreate("Login", 240, 150) GUICtrlCreateLabel("User'", 30, 30) $user = GUICtrlCreateInput ( "", 150, 30, 50, 20) GUICtrlCreateLabel("Pass", 30, 55) $pass = GUICtrlCreateInput ( "", 150, 55, 70, 20, $ES_PASSWORD) $ok = GUICtrlCreateButton("OK", 70, 80, 60) GUICtrlSetOnEvent($ok, "saveinfo") GUISetState(@SW_SHOW) Func saveinfo() $username = GUICtrlRead($user) $password = GUICtrlRead($pass) WinClose("Login") EndFunc How can i close the window when the button is clicked? I've tried WinClose("Login"), but nothing happens... Hope you can help me Link to comment Share on other sites More sharing options...
BigDod Posted December 29, 2005 Share Posted December 29, 2005 I have a script, which creates a window with login and password input. When you click the OK button, the values from the inputs must be saved in variables, and then close the window. I can't get the button to close the window, when you click it. How do I do that? The part of the script which creates the windows looks like this: $loginwindow = GUICreate("Login", 240, 150) GUICtrlCreateLabel("User'", 30, 30) $user = GUICtrlCreateInput ( "", 150, 30, 50, 20) GUICtrlCreateLabel("Pass", 30, 55) $pass = GUICtrlCreateInput ( "", 150, 55, 70, 20, $ES_PASSWORD) $ok = GUICtrlCreateButton("OK", 70, 80, 60) GUICtrlSetOnEvent($ok, "saveinfo") GUISetState(@SW_SHOW) Func saveinfo() $username = GUICtrlRead($user) $password = GUICtrlRead($pass) WinClose("Login") EndFunc How can i close the window when the button is clicked? I've tried WinClose("Login"), but nothing happens... Hope you can help me Try using GUIDelete. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
effer Posted December 29, 2005 Author Share Posted December 29, 2005 Try using GUIDelete.Nice, works like a charm Havent seen that function in the help files Thanks for the answer Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now