Strydr Posted November 2, 2018 Share Posted November 2, 2018 (edited) I thought I understood this but a simple script isn't working. What am I missing? Yes, I'm expecting to feel very stupid, but thanks for the help! I was working on learning arrays and all of a sudden realized that I seem to have forgotten some basics! What am I missing? Why won't the button activate the function "_TestFunc" "OnEvent"? Thank you! Quote #include <GUIConstantsEx.au3> #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $GUI = GUICreate("Test GUI", 400, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU, $WS_EX_CLIENTEDGE)) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") Global $testbutton = GUICtrlCreateButton("test", 100, 50) GUISetOnEvent($testbutton, "_TestFunc") GUISetState(@SW_SHOW) While Sleep(100) WEnd Func Quit() Exit EndFunc Func _TestFunc() MsgBox(0, "", "testing") EndFunc Edited November 2, 2018 by Strydr Link to comment Share on other sites More sharing options...
Xandy Posted November 2, 2018 Share Posted November 2, 2018 (edited) "Am I missing something basic?" Yes. Use, GUICtrlSetOnEvent($testbutton, "_TestFunc")) Not GUISetOnEvent($testbutton, "_TestFunc") Edited November 2, 2018 by Xandy Strydr, FrancescoDiMuro and Bilgus 3 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Strydr Posted November 2, 2018 Author Share Posted November 2, 2018 OMG! That one keeps tripping me up!!! Thank you!!!!! Xandy 1 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