TForm1=class(TForm)
  ...
  VieworEdit:byte;...procedure TForm1.Button1Click(sender:TObject);
begin
  VieworEdit:=1;
  Form2.Showmodal;
end;procedure TForm1.Button2Click(sender:TObject);
begin
  VieworEdit:=2;
  Form2.Showmodal;
end;Unit2中if Form1.VieworEdit=1 then
  dosomething
else if Form1.VieworEdit=2 then
  do anotherthing;