Jump to content

ControlMove is moving the wrong thing.


Recommended Posts

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
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...