AGEN BUS KENCANA SAKTI
untuk kesempatan kali ini, ane mau share aja tentang VB ni siapa tahu ada yang butuh hehheheee.....
Listing
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure
TForm1.Timer1Timer(Sender: TObject);
begin
ljam.Caption:=timetostr(time);
ltanggal.Caption:=datetostr(date);
if labeL9.Visible=true then
begin
if label9.Left<320 then
label9.Left:=label9.Left+3
else
label9.Left:=6;
end;
end;
procedure TForm1.FormCreate(Sender:
TObject);
begin
ckode.Items.Add('--pilih--');
ckode.Items.Add('DD');
ckode.Items.Add('DJ');
ckode.Items.Add('SJ');
end;
procedure TForm1.ckodeClick(Sender:
TObject);
begin
if ckode.Text='DD' then
enama.Text:='Dewi Sri'
else if ckode.Text='DJ' then
enama.Text:='Dedy Jaya'
else if ckode.Text='SJ' then
enama.Text:='Sinar Jaya'
else
enama.Text:='0'
end;
procedure
TForm1.bcloseClick(Sender: TObject);
begin
if application.MessageBox('yakin
ingin keluar program?','info',mb_yesno)=idyes then
Application.Terminate;
end;
procedure TForm1.rpagiClick(Sender:
TObject);
begin
eharga.Text:='35000';
ejumbel.SetFocus;
end;
procedure
TForm1.rsiangClick(Sender: TObject);
begin
eharga.Text:='45000' ;
ejumbel.SetFocus;
end;
procedure
TForm1.emalemClick(Sender: TObject);
begin
eharga.Text:='60000';
ejumbel.SetFocus;
end;
procedure
TForm1.ejumbelKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
etotal.Text:=floattostr(strtofloat(eharga.Text)*strtofloat(ejumbel.Text));
eubay.SetFocus;
end;
end;
procedure
TForm1.eubayKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
eukem.Text:=floattostr(strtofloat(eubay.Text)-strtofloat(etotal.Text));
end;
procedure
TForm1.bbersihClick(Sender: TObject);
begin
ckode.Text:='pilih';
enama.Text:='';
rpagi.Checked:=false;
rsiang.Checked:=false;
emalem.Checked:=false;
eharga.Text:='0';
ejumbel.Text:='0';
etotal.Text:='0';
eukem.Text:='0';
eubay.Text:='0';
end;
end.
semoga membantu....kalau ada yg kurang jelas silahkan tinggakan komentar hehehhee makasih :)
sangat membantu banget, ane lagi belajar vb.makasi ya tutorial nya.bermanfaat banget
BalasHapus