var<br> Form1: TForm1;<br><br>implementation<br><br>uses Unit2;<br><br>{$R *.dfm}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> form2.Button1.Click;<br>end;<br><br>end.<br><br>//窗体2<br>unit Unit2;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> TForm2 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form2: TForm2;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm2.Button1Click(Sender: TObject);<br>begin<br> showmessage('是这样的吗?');<br>end;<br><br>end.