gottygolly Posted November 25, 2014 Posted November 25, 2014 Any thoughts on why it is moving the wrong button? Func _Test($xCord,$yCord,$Width,$Height) GUICtrlCreateButton("",$xCord,$yCord,$Width,$Height) EndFunc $gui = GUICreate("",300,300,-1,-1) Opt("GUIOnEventMode",1) $Test = _Test(50,50,100,20) $Button = GUICtrlCreateButton("Button",0,0,100,20) GUISetOnEvent(-3,"_Exit") GUICtrlSetOnEvent($Button,"Button") GUISetState() While 1 Sleep(10) WEnd Func _Exit() Exit EndFunc Func Button() $cp = ControlGetPos($gui,"",$Test) ControlMove($gui,"",$Test,$cp[0]+10,$cp[1]+10) EndFunc AquamarineGom 1
kaisies Posted November 25, 2014 Posted November 25, 2014 _Test() needs to return the handle of the button created
gottygolly Posted November 25, 2014 Author Posted November 25, 2014 (edited) I feel dumb now. Thanks for the help. Edited November 25, 2014 by gottygolly
kaisies Posted November 25, 2014 Posted November 25, 2014 I feel dumb now. Thanks for the help. Everyone makes silly code mistakes. Use the rubber duck approach.
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