Professional Documents
Culture Documents
Tugas 2
Tugas 2
begin
if TrackBar1.Position=0 then
shape1.Shape:=strectangle
shape1.Shape:=stcircle
shape1.Shape:=stellipse
shape1.Shape:=stroundrect
shape1.Shape:=stroundsquare
shape1.Shape:=stsquare
end;
end.
begin
if TrackBar2.Position=0 then
shape1.Brush.Style:= bsBDiagonal
shape1.Brush.Style:= bsClear
shape1.Brush.Style:= bscross
shape1.Brush.Style:= bshorizontal
shape1.Brush.Style:= bssolid
shape1.Brush.Style:= bsvertical
end;
begin
if TrackBar3.Position=0 then
shape1.Brush.Color:=clred
shape1.Brush.Color:=clblue
shape1.Brush.Color:=clyellow
shape1.Brush.Color:=clgreen
shape1.Brush.Color:=clwhite
shape1.Brush.Color:=clblack
end;
end;
end.
TUGAS 1
begin
Timer1.Interval:=500;
Timer1.Enabled:=False;
Button1.caption:='Mulai';
Form1.Caption:='Latihan Delphi';
end;
var jumchar:integer;
begin
jumchar:= length(form1.caption);
case jumchar of
1: form1.caption:= form1.caption+'a';
2: form1.caption:= form1.caption+'t';
3: form1.caption:= form1.caption+'i';
4: form1.caption:= form1.caption+'h';
5: form1.caption:= form1.caption+'a';
6: form1.caption:= form1.caption+'n';
8: form1.caption:= form1.caption+'D';
9: form1.caption:= form1.caption+'e';
end;
end;
begin
timer2.Interval:=500;
timer2.Enabled:=false;
button1.Caption:='mulai';
end;
var jumchar:integer;
begin
jumchar:= length(label1.caption);
case jumchar of
1: Label1.caption:= Label1.caption+'o';
2: Label1.caption:= Label1.caption+'n';
3: Label1.caption:= Label1.caption+'t';
4: Label1.caption:= Label1.caption+'o';
5: Label1.caption:= Label1.caption+'h';
8: Label1.caption:= Label1.caption+'r';
9: Label1.caption:= Label1.caption+'o';
end;
end;
begin
timer3.Interval:=500;
timer3.Enabled:=false;
button1.Caption:='mulai';
end;
procedure TForm1.Timer3Timer(Sender: TObject);
var jumchar:integer;
begin
jumchar:= length(Edit1.text);
case jumchar of
1: Edit1.text:= Edit1.text+'n';
2: Edit1.text:= Edit1.text+'i';
3: Edit1.text:= Edit1.text+'m';
4: Edit1.text:= Edit1.text+'a';
5: Edit1.text:= Edit1.text+'s';
6: Edit1.text:= Edit1.text+'i';
8: Edit1.text:= Edit1.text+'d';
9: Edit1.text:= Edit1.text+'e';
end;
end.