LOCAL loForm as Form m.loForm = CREATEOBJECT([formTest]) m.loForm.Show() RETURN ******************************************************************************* DEFINE CLASS formTest as Form nDifXCoord = 0 nDifYCoord = 0 *- Adding objects ADD OBJECT cmdExit as CommandButton ADD OBJECT cmdMove as CommandButton PROCEDURE init() WITH this .WindowType = 1 .Caption = [Move the Button Below!] .Height = 421 .Width = 656 .AutoCenter = .T. *- Setting Exit button WITH .cmdExit .Caption = [\<Exit] .Height = 39 .Width = 152 .Top = 360 .Left = 264 .Visible = .T. ENDWITH *- Setting Move button WITH .cmdMove .Caption = [Move Me Within of the Form] .Height = 65 .Width = 81 .Top = 24 .Left = 60 .DragMode = 1 .WordWrap = .T. .Visible = .T. ENDWITH ENDWITH ENDPROC PROCEDURE DragDrop() LPARAMETERS oSource, nXCoord, nYCoord oSource.Left = nXCoord - thisForm.nDifXCoord oSource.Top = nYCoord - thisForm.nDifYCoord ENDPROC *- Exit button PROCEDURE cmdExit.Click() ThisForm.Release() ENDPROC *- Move button PROCEDURE cmdMove.MouseMove() LPARAMETERS nButton, nShift, nXCoord, nYCoord thisForm.nDifXCoord = nXCoord - THIS.Left thisForm.nDifYCoord = nYCoord - THIS.Top ENDPROC ENDDEFINEFor more information about Drag and Drop see Creating Drag-and-Drop Controls in VFP help.