Selasa, 06 November 2012

Membuat Aplikasi Kalkulator Sederhana Dengan Delphi 7

1. Buat seperti gambar di bawah ini:

 

2. Tulis script dibawah ini :

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  a,b,c:double;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  ShowMessage('AYO BELAJAR MENGHITUNG');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  a:=strtofloat(Edit1.Text);
  b:=strtofloat(Edit2.Text);
  c:=a+b;
  Edit3.Text :=floattostr(c);

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  a:=strtofloat(Edit1.Text);
  b:=strtofloat(Edit2.Text);
  c:=a-b;
  Edit3.Text :=floattostr(c);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  a:=strtofloat(Edit1.Text);
  b:=strtofloat(Edit2.Text);
  c:=a*b;
  Edit3.Text :=floattostr(c);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  a:=strtofloat(Edit1.Text);
  b:=strtofloat(Edit2.Text);
  c:=a/b;
  Edit3.Text :=floattostr(c);
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
  Edit1.Clear;
  Edit2.Clear;
  Edit3.Clear;
  Edit1.SetFocus;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
  ShowMessage(' "Anda Yakin Akan Keluar" ');
  ShowMessage('Terima Kasih ! "Belajar menghitung yang rajin yaaaa!" ');
  Application.Terminate;
  //close;
end;


end.



3. SELESAI.
        Silahkan mencoba..............!


by : KHAFIDZUN FADLI
 

Programming Delphi 7






Delphi 7 Personal Splash screen.
KimeroAdded by Kimero
Delphi 7 is a very popular pre-.net Delphi version. It was announced in August 6, 2002.


Delphi 7 Personal customized IDE.
KimeroAdded by Kimero

  • Delphi 7 Architect
  • Delphi 7 Enterprise
  • Delphi 7 Professional
  • Delphi 7 Personal
    • (There used to be a free download from borland.pl which could be activated at CodeGear. Both links are defunct.)

Downloads/UpdatesEdit

See alsoEdit

Delphi Versions
Win16 Delphi 1
Win32 Delphi 2Delphi 3Delphi 4Delphi 5Delphi 6Delphi 7Delphi 2007 for Win32
.NET Delphi 8
Win32 + .NET: Borland Developer Studio 2005Borland Developer Studio 2006CodeGear RAD Studio 2007CodeGear RAD Studio 2009
Other: KylixDelphi for PHP3rdRailTurbo Delphi 2006
More info: Release Dates and CodenamesCompiler Release DatesCompiler Conditional Defines