Vcl.DBCtrls.TDBCheckBox.ValueChecked

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ValueChecked: string read FValueCheck write SetValueCheck stored IsValueChecked nodefault;

C++

__property System::UnicodeString ValueChecked = {read=FValueCheck, write=SetValueCheck, stored=IsValueChecked};

Properties

Type Visibility Source Unit Parent
property published
Vcl.DBCtrls.pas
Vcl.DBCtrls.hpp
Vcl.DBCtrls TDBCheckBox

Description

Specifies the field value that corresponds to the checked state of the check box.

Use ValueChecked to specify the field value represented by the check box when it is checked. If the value of the ValueChecked property is equal to the data in the field of the current record of the dataset, the database check box appears checked. When the user checks the database check box, the field value is set to ValueChecked.

ValueChecked can represent more than one value in a semicolon-delimited list of items. If any of the items matches the contents of the field of the current record in the dataset, the check box appears checked. For example, set the value of ValueChecked string like this:



DBCheckBox1.ValueChecked := 'True;Yes;On';



DBCheckBox1->ValueChecked = "True;Yes;On";



If the contents of the associated field is the string true, Yes, or On, the check box is checked. The value of the field is compared to ValueChecked in a case-insensitive comparison. If the user selects a check box where ValueChecked represents more than one value, the first item in the list is assigned to the field.

If the contents of the field of the current record matches a string specified as the value of the ValueUnchecked property, the check box appears unchecked. If the contents of the field matches no string in either ValueChecked or ValueUnchecked, the check box appears gray.

Note: If the DataField of the database check box is a logical field, the check box is always checked if the contents of the field is true, and it is always unchecked if the contents of the field is false. The values of the ValueChecked and ValueUnchecked properties have no affect on logical fields.

See Also