define class clsMover as Label Caption = "Click and drag me!" BackStyle = 0 AutoSize = .T. * holds reference to object being moved oLinkedObject = .Null. * remember mouse position at start of drag OriginalXpos = 0 OriginalYpos = 0 * remember original object being moved's position OriginalLeft = 0 OriginalTop = 0 * clear linked object function Destroy() This.oLinkedObject = .Null. endfunc function MouseDown lparameters nButton, nShift, nXCoord, nYCoord if nButton = 1 and vartype( This.oLinkedObject ) == "O" with This .OriginalXPos = nXCoord .OriginalYPos = nYCoord .OriginalLeft = This.oLinkedObject.Left .OriginalTop = This.oLinkedObject.Top endwith endif endfunc function MouseMove lparameters nButton, nShift, nXCoord, nYCoord if nButton = 1 and vartype( This.oLinkedObject ) == "O" with this .OriginalLeft = .OriginalLeft + (nXCoord - .OriginalXPos) .OriginalTop = .OriginalTop + (nYCoord - .OriginalYPos) .oLinkedObject.Move(.OriginalLeft,.OriginalTop) endwith endif endfunc enddefineRegards