RAD Studio VCL Reference
|
Indicates whether the check box is selected, deselected, or grayed.
property State: TCheckBoxState;
__property TCheckBoxState State;
Use State to determine whether the check box is checked (cbChecked), unchecked (cbUnchecked), or grayed (cbGrayed).
C++ Examples:
/* 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. */ void __fastcall TForm1::FormCreate(TObject *Sender) { CheckBox1->AllowGrayed = true; CheckBox1->State = cbChecked; }
Delphi Examples:
{ 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;
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|