RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomCheckBox.AllowGrayed Property

Determines whether check box can be in a "grayed" state.

Pascal
property AllowGrayed: Boolean;
C++
__property Boolean AllowGrayed;

If AllowGrayed is set to true, the check box has three possible states: checked, unchecked, and grayed. If AllowGrayed is set to false, the check box has only two possible states: checked and unchecked.  

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;

 

Checked 

State

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!