unit AllowGrayed;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    CheckBox1: TCheckBox;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: AllowGrayed
// Property: StdCtrls.TCustomCheckBox.AllowGrayed
// Property: StdCtrls.TCustomCheckBox.State

// BeginCode
{
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;
// EndCode
// EndExample: AllowGrayed
end.
