Protheus Posted June 3, 2005 Posted June 3, 2005 Dear all, I want to create a GUI - from the GUI you select what prinetr you want to install and press the install button and the printer is instaled. I want to create a cancel button - buty after two days I am no further in getting it o work. Below is the script I created so far - the problem is that when you press the cancel it shoudl close the GUI but is does not doe anything. ----------------------------------------------------------------------------------------------- expandcollapse popup#include <GUIConstants.au3> WinClose ("Printer Installation"); closed any open window Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainwindow = GUICreate("Printer Installation Menu", 300, 100) GUISetOnEvent ($GUI_EVENT_CLOSE, "closemainwindow") GUICtrlCreateGroup ("Choose Printer To Install", 30, 5, 150, 43) ;$printer_01 = GUICtrlCreateCombo ("", 30, 20, 140, 20, "$CBS_DROPDOWN", "") GUICtrlCreateCombo ("B2_FL4_BW2", 35,20,140, 20); create first item GUICtrlSetData(-1,"Printer_02|Printer_03|Printer_04","B2_FL4_BW2"); add other item and set a new default GUICtrlCreateGroup ("",-99,-99,1,1) $installbutton = GUICtrlCreateButton ("Install", 35, 55, 60) $cancelbutton = GUICtrlCreateButton ("Cancel", 115, 55, 60) GUISetOnEvent ($cancelbutton, "cancelbuttonpressed") GUISetState(@SW_SHOW) While 1 Sleep(10) ; Idle around WEnd ;-------------------Start of all Functions--------------------------------- Func closemainwindow() Exit EndFunc -- Func cancelbuttonpressed() WinClose ("Printer Installation Menu") EndFunc
buzz44 Posted June 3, 2005 Posted June 3, 2005 Two things come to mind.1. The title you are using is wrong.2. Try using WinKill() instead of WinClose(). qq
Protheus Posted June 3, 2005 Author Posted June 3, 2005 Two things come to mind.1. The title you are using is wrong.2. Try using WinKill() instead of WinClose().<{POST_SNAPBACK}>What is wrong with the title ?
buzz44 Posted June 3, 2005 Posted June 3, 2005 (edited) I don't know. A typo? That might not even be the problem Edited June 3, 2005 by Burrup qq
jpm Posted June 3, 2005 Posted June 3, 2005 GUISetOnEvent ($cancelbutton, "cancelbuttonpressed")should be GUICtrlSetOnEvent ($cancelbutton, "cancelbuttonpressed")<{POST_SNAPBACK}>
Protheus Posted June 3, 2005 Author Posted June 3, 2005 woeoeoeoeoeo.... a simple typo - tnx you guys - me very happy now :-)
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