>LOCAL; > loActiveControl > >THISFORM.LOCKSCREEN = .T. >*Check if a Control is focused and if it could receive focus again >IF TYPE('THISFORM.ACTIVECONTROL')='O'; > AND !ISNULL(THISFORM.ACTIVECONTROL); > AND PEMSTATUS(THISFORM.ACTIVECONTROL,'SETFOCUS',5) THEN > loActiveControl = THISFORM.ACTIVECONTROL >ELSE &&TYPE('.ACTIVECONTROL' ... > loActiveControl = NULL >ENDIF &&TYPE('.ACTIVECONTROL' ... > >*YourGrid.SETFOCUS() >*Get your properties > >*Re - Focus last Object >IF !ISNULL(loActiveControl) THEN > loActiveControl.SETFOCUS() >ENDIF &&!ISNULL(loActiveControl) >THISFORM.LOCKSCREEN = .F. >>
lparameters DoNotGoDownIfGrid local _ActiveControl, _ActiveColumn, i, x if( type('thisform.ActiveControl') == T_UNDEFINED ) return Null else _ActiveControl = thisform.ActiveControl endif if( !(type('_ActiveControl') == T_OBJECT ) ) assert FALSE endif if( !DoNotGoDownIfGrid and (Proper(_ActiveControl.BaseClass) == 'Grid') ) _ActiveColumn = _ActiveControl.ActiveColumn if( !empty(_ActiveColumn) ) for i = 1 to _ActiveControl.ColumnCount x = _ActiveControl.Columns[i] if( x.ColumnOrder == _ActiveColumn ) exit endif endfor for i = 1 to x.ControlCount if ( x.Controls[i].Name == x.CurrentControl ) _ActiveControl = x.Controls[i] exit endif endfor endif endif return _ActiveControl