Buat tampilan form agar tampak seperti berikut :
Lalu masukkan syntax-syntax berikut pada procedure yang dibutuhkan.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button2: TButton;
Label4: TLabel;
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);
begin
edit3.Text:='Nama saya adalah '+edit1.Text+'. NPM saya adalah '+edit2.Text+'.'
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
application.terminate;
end;
end.
Lalu masukkan syntax-syntax berikut pada procedure yang dibutuhkan.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button2: TButton;
Label4: TLabel;
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);
begin
edit3.Text:='Nama saya adalah '+edit1.Text+'. NPM saya adalah '+edit2.Text+'.'
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
application.terminate;
end;
end.
0 comments:
Posting Komentar