o1 = createobject( "myform" ) o1.windowstate = 2 o1.show() read events define class myform as form nx = 0 ny = 0 add object con1 as container with dragmode = 0 procedure con1.mousedown lparameters nButton, nShift, nX, nY thisform.nx = nx thisform.ny = ny this.Drag( 1 ) procedure dragover lparameters oSource, nX, nY, nState wait window nowait at 10, 10 ; "state:" + transform( nstate ) + ; " x:" + transform( nX ) + ; " y:" + transform( nY ) procedure dragdrop lparameters oSource, nX, nY oSource.Drag( 2 ) oSource.Left = oSource.Left + nX - thisform.nx oSource.Top = oSource.Top + nY - thisform.ny procedure queryunload clear events enddefine