Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
- type
- TForm1 = class(TForm)
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Edit1: TEdit;
- Edit2: TEdit;
- Edit3: TEdit;
- Button1: TButton;
- Button2: TButton;
- procedure FormCreate(Sender: TObject);
- procedure Edit1Exit(Sender: TObject);
- procedure Edit3Exit(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- SenhaNova, ConfSenha: string;
- VelhaSenha: string;
- implementation
- {$R *.dfm}
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- //button1.Enabled:=false;
- end;
- //abilita o edit 2 e 3, se o edit1 estiver correto
- procedure TForm1.Edit1Exit(Sender: TObject);
- begin
- button1.Enabled:=false;
- VelhaSenha:=Edit1.text;
- if Edit1.Text='Delphi' then
- begin
- Edit2.Enabled:=true;
- Edit3.enabled:=true;
- end
- else begin
- Edit2.Enabled:=false;
- Edit3.Enabled:=false;
- end
- end;
- procedure TForm1.Edit3Exit(Sender: TObject);
- begin
- button1.Enabled:=false;
- SenhaNova:=edit2.text;
- ConfSenha:=Edit3.Text;
- if SenhaNova<>confSenha then
- begin
- button1.Enabled:=false;
- end
- else
- Button1.Enabled:=true;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- SenhaNova:=edit2.text;
- ConfSenha:=Edit3.Text;
- if SenhaNova<>confSenha then
- begin
- showmessage('senha errada');
- end
- else
- showmessage('senha correta');
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement