You are on page 1of 3

Nama : ARIS HIDAYAT NIM : 11650014

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons; type TForm1 = class(TForm) BitBtn1: TBitBtn; BitBtn2: TBitBtn; Label1: TLabel; Label2: TLabel; Edit2: TEdit; Edit1: TEdit; procedure BitBtn1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses Unit2; {$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject); begin Form1.Hide; Form2.Show; end; end.

unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons; type TForm2 = class(TForm) Edit1: TEdit; Label1: TLabel; Label2: TLabel; BitBtn1: TBitBtn; BitBtn2: TBitBtn; Edit2: TEdit; procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation uses Unit1; {$R *.dfm} procedure TForm2.BitBtn1Click(Sender: TObject); begin if Edit1.Text=Form1.Edit1.Text then begin if Edit2.Text=form1.Edit2.Text then begin ShowMessage('password dan username sudah benar'#13' end; if edit2.Text<>form1.Edit2.Text then begin ShowMessage('input password salah'); Edit2.SetFocus; end; end; if Edit1.Text<>Form1.Edit1.Text then begin ShowMessage('input username salah'); Edit1.SetFocus; end; end; procedure TForm2.BitBtn2Click(Sender: TObject); begin ShowMessage('Anda ingin membatalkan Login ???'); form2.Hide; form1.Show; end; end.

Anda berhasil Login');

RUNNING

You might also like