oform = Newobject("testmove") oform.Show Read Events Define Class testmove As Form BorderStyle = 2 Caption = "testmove" AlwaysOnTop = .T. BackColor = Rgb(255,255,255) Name = "testmove" scalemode = 3 oObj = NULL width = 900 height = 700 Procedure MouseDown Lparameters nButton, nShift, nXCoord, nYCoord this.moveobject( nXCoord, nYCoord ) return function init lcNewObjName = 'theObject' this.newobject( m.lcNewObjName, 'label' ) this.oObj = this.&lcNewObjName this.&lcNewObjName..visible = .t. return function queryunload clear dlls Sleep clear events return function keypress LPARAMETERS nKeyCode, nShiftAltCtrl if inlist( nKeyCode, 27, 113, 32 ) clear events endif return function moveobject lparameter tnToLeft, tnToTop local lnStep, ln, lnT, lnL with this lnStep = 30 lnT = ( m.tnToTop - .oObj.top ) / m.lnStep lnL = ( m.tnToLeft - .oObj.left ) / m.lnStep with .oObj for ln = 1 to m.lnStep * .caption = transform( m.ln ) .top = .top + m.lnT .left = .left + m.lnL * pause( 2 / m.lnStep ) next endwith endwith enddefine FUNCTION Pause( tnSeconds ) DECLARE Sleep in WIN32API integer Sleep( max( 0, tnSeconds ) * 1000 ) RETURN