看了jsxjd的方法,改了一下:
procedure TForm1.Button1Click(Sender: TObject);
var
n,i:integer;
begin
// n:=form2.left;
n := Form2.Width;
// form2.left:=-form2.width;
Form2.Width := 0;
Form2.show;
// while form2.left<ndo
while Form2.Width < ndo
begin
// form2.left:=form2.left+20;
Form2.Width := Form2.Width + 5;
Sleep(20);
end;
for I := 0 to Form2.ControlCount - 1do
Form2.Controls.Visible := True;
end;
另外在Form2的OnResize事件中加上:
procedure TForm2.FormResize(Sender: TObject);
var
I: Integer;
begin
for I := 0 to Self.ControlCount - 1do
Self.Controls.Visible := False;
end;