Unit1.pas 655 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. edt1: TEdit;
  10. btn1: TButton;
  11. lbl2: TLabel;
  12. procedure btn1Click(Sender: TObject);
  13. private
  14. { Private declarations }
  15. public
  16. { Public declarations }
  17. end;
  18. var
  19. Form1: TForm1;
  20. implementation
  21. {$R *.dfm}
  22. { Realiza la acción de procesar la clave. }
  23. procedure TForm1.btn1Click(Sender: TObject);
  24. begin
  25. if edt1.Text = 'abc123' then
  26. begin
  27. lbl2.Caption := 'Clave correcta'
  28. end
  29. else
  30. begin
  31. lbl2.Caption := 'Clave incorrecta'
  32. end;
  33. end;
  34. end.