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;
...
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;
Form2.Edit1.ReadOnly := True;
Form2.Show;
unit1加上uses unit2,unit2的implentation后面加上uses unit1