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.cntMain.oMover.Move( 10, 6 ) * register this toolbar as the object to move This.cntMain.oMover.oLinkedObject = This This.cntMain.oMover.Visible = .T. endfunc enddefine * custom label class that captures move request and transfers to linked object 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 *!* DECLARE INTEGER GetDesktopWindow IN WIN32API *!* DECLARE INTEGER LockWindowUpdate IN WIN32API INTEGER lnHandle *!* local lnDesktopWin *!* lnDeskTopWin = GetDeskTopWindow() *!* = LockWindowUpdate(lnDeskTopWin) local lnLeft, lnTop lnLeft = .OriginalLeft + ( nXCoord - .OriginalXpos ) lnTop = .OriginalTop + ( nYCoord - .OriginalYpos ) * doesn't appear to affect problem *!* doevents && doesn't affect problem * HERE'S THE CAUSE OF THE FLASHY PAINTING EFFECT !!! .oLinkedObject.Move( lnLeft, lnTop ) *!* doevents && doesn't affect problem *!* = LockWindowUpdate(0) endwith endif endfunc enddefine