public oToolbarTest oToolbarTest = createobject("clsToolbarTest") oToolbarTest.Show() * standard toolbar define class clsToolbarTest as Toolbar ShowWindow = 1 && in top level form add object cntMain as Container with height = 100, width = 200 function Init() * add object that manages the move This.cntMain.AddObject( "oMover", "clsMover",THIS,_SCREEN) This.cntMain.oMover.Move( 10, 6 ) * register this toolbar as the object to move This.cntMain.oMover.Visible = .T. ENDFUNC enddefine define class clsMover as Label Caption = "Click and drag me!" BackStyle = 0 AutoSize = .T. * holds reference to object being moved oLinkedObject = .Null. oForm = .NULL. * remember mouse position at start of drag OriginalXpos = 0 OriginalYpos = 0 * remember original object being moved's position OriginalLeft = 0 OriginalTop = 0 FUNCTION Init(loLinked,loForm) THIS.oLinkedObject = loLinked THIS.oForm = loForm ENDFUNC * clear linked object function Destroy() This.oLinkedObject = .NULL. THIS.oForm = .NULL. endfunc function MouseDown lparameters nButton, nShift, nXCoord, nYCoord if nButton = 1 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 WITH THIS .OriginalLeft = MIN(MAX(.OriginalLeft + nXCoord - .OriginalXPos,0),.oForm.Width-.oLinkedObject.Width) .OriginalTop = MIN(MAX(.OriginalTop + nYCoord - .OriginalYPos,0),.oForm.Height-.oLinkedObject.Height) .oLinkedObject.Move(.OriginalLeft,.OriginalTop) ENDWITH endif endfunc enddefineRegards