0% found this document useful (0 votes)
16 views7 pages

Script 2

The document defines a form with 10 buttons that change the form's color or text when clicked. Each button click procedure changes the form or button colors or captions.

Uploaded by

rizal182
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views7 pages

Script 2

The document defines a form with 10 buttons that change the form's color or text when clicked. Each button click procedure changes the form or button colors or captions.

Uploaded by

rizal182
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

unit Unit1;

interface

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

type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; Button5: TButton; Button6: TButton; Button7: TButton; Button8: TButton; Label1: TLabel; Button9: TButton; Button10: 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 Button7Click(Sender: TObject); procedure Button8Click(Sender: TObject); procedure Button10Click(Sender: TObject); procedure Button9Click(Sender: TObject); private { Private declarations } public { Public declarations } end;

var Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject); begin Form1.Color:=clred; button1.caption:='Red'; end;

procedure TForm1.Button2Click(Sender: TObject); begin

form1.Color:=clwhite; button2.caption:='White'; end;

procedure TForm1.Button3Click(Sender: TObject); begin form1.color:=clblue; button3.caption:='Blue';

end;

procedure TForm1.Button4Click(Sender: TObject); begin form1.color:=clgreen; button4.caption:='Green'; end;

procedure TForm1.Button5Click(Sender: TObject); begin form1.color:=clyellow; button5.caption:='Yellow';

end;

procedure TForm1.Button6Click(Sender: TObject); begin

form1.color:=clpurple; button6.caption:='Puple'; end;

procedure TForm1.Button7Click(Sender: TObject); begin form1.color:=clsilver; button7.caption:='Silver'; end;

procedure TForm1.Button8Click(Sender: TObject); begin form1.color:=clSkyBlue; button8.caption:='Sky Blue';

end;

procedure TForm1.Button10Click(Sender: TObject); begin application.Terminate end;

procedure TForm1.Button9Click(Sender: TObject); begin button1.Caption := 'Merah'; button2.Caption := 'Putih';

button3.Caption := 'Biru'; button4.Caption := 'Hijau'; button5.Caption := 'Kuning'; button6.Caption := 'Ungu'; button7.Caption := 'Abu - Abu'; button8.Caption := 'BiruLangit'; Form1.Color := clBtnFace;

end;

end.

Bab I Input Output Software Belajar Bahasa Inggris dan Warnanya

You might also like