[Overview][Constants][Types][Classes][Procedures and functions][Index] |
The check, unchecked, or grayed state for the control.
Source position: stdctrls.pp line 1360
public property TCustomCheckBox.State : TCheckBoxState |
State is a TCheckBoxState property which indicates whether the check box is checked, unchecked or grayed (disabled). The default value for the property is cbUnchecked. State allows the control to be set to the indeterminate (grayed) state when AllowGrayed is set to True. Otherwise, it is the same as using the Checked property.
Reading the property value calls RetrieveState to get the value from the widgetset class when its handle has been allocated. Otherwise, the existing value for the member is used. Changing the value for the property causes ApplyChanges to be called to send the new property value to the widget.
See TCheckBoxState for the available enumeration values and their meanings in the State property.
|
Gets the checked state for the control from the widgetset class. |
|
|
Sets the checked state in the widgetset class and redraws the control. |
|
|
Indicates the checked state for the control. |
|
|
Represents the states for a check box. |
{ This example uses a check box on a form. When the application runs, the check box is initially checked. When the user clicks it, the check box is unchecked. Clicking it again grays the check box. } procedure TForm1.FormCreate(Sender: TObject); begin Checkbox1.AllowGrayed := True; Checkbox1.State := cbChecked; end;