Applies To: | ButtonEdit | Edit | Spinner |
Description
This property applies to an Edit object with Style Single and specifies whether or not an empty field is considered to be valid. It also applies to a Spinner. Its value is either 0 (an empty field is not valid) or 1 (an empty field is valid. If the FieldType is Numeric, LongNumeric, Currency, Date or Time, the default value for ValidIfEmpty is 0. Otherwise, its default value is 1.
If ValidIfEmpty is 0 and the user attempts to leave the Edit object by shifting the input focus to another control, or by selecting a Button or MenuItem, the Edit object will generate a BadValue event. The Text property will reflect the appearance of the field and be empty, but the Value property will not be changed.
If ValidIfEmpty is 1 and the FieldType is Numeric, LongNumeric, Currency, date or Time, the Value property will be set to ⍬ when the user clears the field and leaves it.