Saturday, October 20, 2012

Latihan Membuat Program Perkenalan

1. Contoh Latihan Program Delphi  Perkenalan

Desain Form 1.1























Hasil Yang Diperoleh 1.2









Listing Membuat Program Perkenalan

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    eperkenalan: TLabel;
    enama: TEdit;
    ehasil: TButton;
    ekeluar: TButton;
    Label1: TLabel;
    Label2: TLabel;
    ekelas: TEdit;
    Label4: TLabel;
    bhapus: TButton;
    procedure ehasilClick(Sender: TObject);
    procedure bhapusClick(Sender: TObject);
    procedure ekeluarClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ehasilClick(Sender: TObject);
begin
label4.caption:=enama.Text + ' ' + ekelas.Text;
end;

procedure TForm1.bhapusClick(Sender: TObject);
begin
enama.Text:='';
ekelas.Text:='';
Label4.Caption:='';
end;

procedure TForm1.ekeluarClick(Sender: TObject);
begin
close;
end;

end.






0 comments:

Post a Comment