Unit1.pas 602 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. unit Unit1;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, StdCtrls;
  6. type
  7. TForm1 = class(TForm)
  8. lbl1: TLabel;
  9. chk1: TCheckBox;
  10. btn1: TButton;
  11. procedure chk1Click(Sender: TObject);
  12. private
  13. { Private declarations }
  14. public
  15. { Public declarations }
  16. end;
  17. var
  18. Form1: TForm1;
  19. implementation
  20. {$R *.dfm}
  21. { Realiza la acción del checkbox. }
  22. procedure TForm1.chk1Click(Sender: TObject);
  23. begin
  24. if chk1.Checked then
  25. begin
  26. btn1.Enabled := True;
  27. end
  28. else
  29. begin
  30. btn1.Enabled := False;
  31. end;
  32. end;
  33. end.