在ONTIMER事件下写 begin if Label.Width > 10 then Label.Width :=0 else Inc(Label.width); end;
在ONTIMER事件下写 begin if Label.Width > 10 then Label.Width :=0 else Inc(Label.width); end;
to celeronll 当等于10,我要从10开始减1 啊
var IsMax: Boolean; 在ONTIMER事件下写 begin if IsMax then begin DecWidth; if Label.Width < 0 then begin IsMax := False; IncWidth; end; end else begin IncWidth; if Label.Width > 10 then begin IsMax := True; DecWidth; end; end; end;procedure DecWidth; begin Dec(Label.Width); end;procedure IncWidth; begin Inc(Label.Width); end;
procedure Tform1.Formcreate(sender:Tobject); begin Mytimer.interval:=10; end; procedure TForm1.Timer1timer(...) begin with table1 do begin if width=10 then width:=width-1; if width=0 then width:=width+1; end; end;
begin
if Label.Width > 10 then
Label.Width :=0
else
Inc(Label.width);
end;
begin
if Label.Width > 10 then
Label.Width :=0
else
Inc(Label.width);
end;
IsMax: Boolean;
在ONTIMER事件下写
begin
if IsMax then
begin
DecWidth;
if Label.Width < 0 then
begin
IsMax := False;
IncWidth;
end;
end
else
begin
IncWidth;
if Label.Width > 10 then
begin
IsMax := True;
DecWidth;
end;
end;
end;procedure DecWidth;
begin
Dec(Label.Width);
end;procedure IncWidth;
begin
Inc(Label.Width);
end;
begin
Mytimer.interval:=10;
end;
procedure TForm1.Timer1timer(...)
begin
with table1 do
begin
if width=10 then
width:=width-1;
if width=0 then
width:=width+1;
end;
end;