Program Perubahan Suhu dengan Delphi 7





yeeeeeahhhh,,, ney dia contoh aplikasi perubahan suhu menggunakan Borland Delphi 7.
lumayan gag perlu itung-itung pake kalkulator.heheheee... :)
moga aj bermanfaat ^^
komponen yang dibutuhkan buat program ini yaitu:
1) 2 buah Groupbox
2) 16 buah label
3) 6 buah edit
4) 5 buah button
5) 2 buah timer
6) 6 buah image

hmmmmm....
gag terlalu mudah tapi asyik juga lho bermain menggunakan Borland Delphi 7 dari pada Borland C++.hadooooooh,,,,bikin pusing klo udah ada yang error #@$$%^&*(*^%$$#@$$&*!$^

Nah tahap selanjutnya tinggal coding-coding deh...
bagian ini yang banyak orang paling gag suka >.<
abis nya bikin pusing *kata orang*hohohoo...

ney dia coding nya :
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Edit2: TEdit;
Label7: TLabel;
Edit3: TEdit;
Label8: TLabel;
Label9: TLabel;
Button1: TButton;
Button2: TButton;
Label10: TLabel;
Timer1: TTimer;
Button3: TButton;
GroupBox1: TGroupBox;
Label3: TLabel;
GroupBox2: TGroupBox;
Label11: TLabel;
Label12: TLabel;
Button4: TButton;
Label13: TLabel;
Button5: TButton;
Label14: TLabel;
Label15: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Timer2: TTimer;
Label16: TLabel;
Image5: TImage;
Image6: TImage;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}



procedure TForm1.Button1Click(Sender: TObject);
var c,r,f : real;
begin
c :=strtoint(edit1.Text);
r := 4/5*c;
f := (9/5*c)+32;
edit3.Text :=floattostr(r);
edit2.Text :=floattostr(f);

end;
procedure TForm1.Button4Click(Sender: TObject);
var c,r,f : real;
begin
r := strtoint(edit4.Text);
c := 5/4*r;
f := (9/4*r)+32;
edit6.Text :=floattostr(c);
edit2.Text :=floattostr(f);

end;

procedure TForm1.Button5Click(Sender: TObject);
var c,r,f : real;
begin
f := strtoint(edit5.Text);
c := (f-32)/(9/5);
r := (f-32)/(9/4);
edit6.Text :=floattostr(c);
edit3.Text :=floattostr(r);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.Text :='0';
edit2.Text :='0';
edit3.Text :='0';
edit4.Text :='0';
edit5.Text :='0';
edit6.Text :='0';
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if label10.Left = 400 then label10.Left := -107;
label10.Left := label10.Left-1;
if image1.Left = 400 then image1.Left := -107;
image1.Left := image1.Left+1;
if image2.Top = 400 then image2.Top := -107;
image2.Top := image2.Top+1;
if image5.Left = 400 then image5.Left := -107;
image5.Left := image5.Left+1;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
if image3.Left = 400 then image3.Left := -107;
image3.Left := image3.Left-1;
if image4.Top = 400 then image4.Top := -107;
image4.Top := image4.Top+1;
if image6.Top = 400 then image6.Top := -107;
image6.Top := image6.Top-1;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
showmessage
('***........MATUR NUWUN......PARENG......***');
CLOSE;
end;
end.



moga bisa bermanfaat.OKEY.....

Category:

0 komentar:

Posting Komentar