If DoDefault() IF EMPTY(THIS.VALUE) RETURN .F. ENDIF EndifThe problem, of course, is that this doesn't really make sense, since the 'DoDefault()' may have other code in it besides the 'ReadOnly' condition. If you know for certain that DoDefault() will only return .T. if the control is ReadOnly, and for no other reason, then this will work.
Local llRetVal llRetVal = .T. If !This.ReadOnly IF EMPTY(THIS.VALUE) llRetVal = .F. ENDIF Endif Return llRetValAlan
> ********************************************************************************** > * Code from "Control Valid() Fires Even When Read-Only" - FoxPro Advisor, May 2003 > ********************************************************************************** > IF THIS.READONLY > RETURN .T. > ENDIF > ********************************************************************************** > > * NOTE: If ReadOnly = .F., still returns .T. >>
> DODEFAULT() > > * If the control is ReadOnly, I don't want this to occur! > IF EMPTY(THIS.VALUE) > RETURN .F. > ENDIF >>