Andrew Peacock Posted May 9, 2007 Posted May 9, 2007 Hi all, I'm having problems on an app I'm working on, so I've pared out the irrelevant code to produce the following: #Include <Constants.au3> #include <GUIConstants.au3> #include <Color.au3> #include <Array.au3> #include <File.au3> #Include <Misc.au3> AutoItSetOption("GuiOnEventMode",1) ; Go to on-event mode $gui = GUICreate("Stay On Focus!", 600,500) $btnDelete0 = guictrlcreatepic("delete.jpg", 530, 30, 16, 16, bitor($SS_NOTIFY, $GUI_SS_DEFAULT_PIC)) GUISetOnEvent($btnDelete0, "deleteTask0") GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd func deleteTask0() msgbox(0, "deleting 0", "") ;deleteTask(0) EndFunc Can anyone see why a click on the icon does not result in the msgbox being displayed? (Icon attached for handy reference!) Regards, Andy
Azazel Posted May 9, 2007 Posted May 9, 2007 (edited) Andrew Peacock you make a mistake it's not "GUISetOnEvent" you have to use but "GUICtrlSetOnEvent" Good continuation Aza #Include <Constants.au3> #include <GUIConstants.au3> #include <Color.au3> #include <Array.au3> #include <File.au3> #Include <Misc.au3> AutoItSetOption("GuiOnEventMode",1) ; Go to on-event mode $gui = GUICreate("Stay On Focus!", 600,500) $btnDelete0 = guictrlcreatepic("delete.jpg", 530, 30, 16, 16, bitor($SS_NOTIFY, $GUI_SS_DEFAULT_PIC)) GUICtrlSetOnEvent($btnDelete0,"deleteTask0") ;GUISetOnEvent($btnDelete0, "deleteTask0") GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd func deleteTask0() msgbox(0, "deleting 0", "") ;deleteTask(0) EndFunc Edited May 9, 2007 by Azazel
Andrew Peacock Posted May 9, 2007 Author Posted May 9, 2007 Andrew Peacock you make a mistake it's not "GUISetOnEvent" you have to use but "GUICtrlSetOnEvent" Good continuation Aza Doh! What a numpty I am! Thanks very much :-) (NB: numpty = Scottish word for "idiot") Andy
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