interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
Vcl.Imaging.pngimage;
type
TForm1 = class(TForm)
Image1: TImage;
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Shape7: TShape;
Shape8: TShape;
Shape9: TShape;
Shape10: TShape;
Shape11: TShape;
Shape12: TShape;
Shape13: TShape;
Shape14: TShape;
Shape15: TShape;
Shape16: TShape;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Button1: TButton;
Button2: TButton;
ComboBox1: TComboBox;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
titik: integer;
status: string;
pos: string;
begin
titik := comboBox1.ItemIndex;
status := Edit1.Text;
if titik <> -1 then
begin
//showmessage ( 'pos yang dipilih : ' + comobox1.items [titik]);
pos := comboBox1.Items[titik];
end
else
begin
//showmessage ('kosong');
pos :='';
end;
if (pos='1') and (status='H') then
begin
shape1.Brush.Color := clLime;
end
else if (pos='1') and (status='K') then
begin
shape1.Brush.Color:= clyellow;
end
else if (pos='1') and (status='M') then
begin
shape1.Brush.Color:= clred;
end
else if (pos='1') and (status='H') then
begin
shape1.Brush.Color:= cllime;
end
else if (pos='2') and (status='K') then
begin
shape2.Brush.Color:= clyellow;
end
else if (pos='2') and (status='M') then
begin
shape2.Brush.Color:= clred;
end
else if (pos='2') and (status='H') then
begin
shape2.Brush.Color:= cllime;
end
else if (pos='3') and (status='K') then
begin
shape3.Brush.Color:= clyellow;
end
else if (pos='3') and (status='M') then
begin
shape3.Brush.Color:= clred;
end
else if (pos='3') and (status='H') then
begin
shape3.Brush.Color:= cllime;
end
else if (pos='4') and (status='K') then
begin
shape4.Brush.Color:= clyellow;
end
else if (pos='4') and (status='M') then
begin
shape4.Brush.Color:= clred;
end
else if (pos='4') and (status='H') then
begin
shape4.Brush.Color:= cllime;
end
else if (pos='5') and (status='K') then
begin
shape5.Brush.Color:= clyellow;
end
else if (pos='5') and (status='M') then
begin
shape5.Brush.Color:= clred;
end
else if (pos='5') and (status='H') then
begin
shape5.Brush.Color:= cllime;
end
else if (pos='6') and (status='K') then
begin
shape6.Brush.Color:= clyellow;
end
else if (pos='6') and (status='M') then
begin
shape6.Brush.Color:= clred;
end
else if (pos='6') and (status='H') then
begin
shape6.Brush.Color:= cllime;
end
else if (pos='7') and (status='K') then
begin
shape7.Brush.Color:= clyellow;
end
else if (pos='7') and (status='M') then
begin
shape7.Brush.Color:= clred;
end
else if (pos='7') and (status='H') then
begin
shape7.Brush.Color:= cllime;
end
else if (pos='8') and (status='K') then
begin
shape1.Brush.Color:= clyellow;
end
else if (pos='8') and (status='M') then
begin
shape8.Brush.Color:= clred;
end
else if (pos='8') and (status='H') then
begin
shape8.Brush.Color:= cllime;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
form1.Close;
end;
end.
5. Hasil dan pembahasan
a. hasil
b. Pembahasan
pada percobaan diatas apabila dimasukan pada tool edit sandi atau password hiijau,kuning,dan merah maka pada shape yang dimasukan password akan berubah sesuai warna dari password yang dimasukan,untuk keluar dari program aplikasi kita klik tombol close.
6. Kesimpulan
Dalam percobaan tersebut, terdapat sebuah aplikasi atau tool edit sandi atau password. Jika warna-warna tertentu dimasukkan sebagai password (hijau, kuning, atau merah), bentuk atau tampilan yang mewakili password akan berubah sesuai dengan warna yang dimasukkan. Untuk keluar dari program aplikasi ini, pengguna hanya perlu mengklik tombol close.
0 komentar:
Posting Komentar