[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'DBCtrls' (#lcl)

# TDBCheckBox.GetFieldCheckState

GetFieldCheckState - returns the check box state for the current field.

## Declaration

Source position: dbctrls.pp line 674

`protected function TDBCheckBox.GetFieldCheckState: TCheckBoxState; virtual;`

## Function result

Current TCheckBoxState for the control.

## Description

GetFieldCheckState is a TCheckBoxState function used to get the current value for the State property in the data-aware check box control. GetFieldCheckState uses the internal TFieldDataLink instance in the class to access the Field in the linked dataset represented by DataField.

The field type and value are examined to determine the return value for the method. The return value can be one of the following:

cbChecked
  Used when the Boolean value in the Field is True.
cbUnchecked
  Used when the Boolean value in the Field is False, or the String value matched ValueChecked. Also used when the Field has not been assigned (contains Nil).
cbGrayed
  Used when the value in Field is not NULL (depends on the database and the field type), and when none of the previous conditions are True.

The return value is assigned to the State property when the DoOnChange and DataChange methods are executed.