不要传递变量,传递函数,例:<br>procedure ShowMDIForm(Sender: TObject);<br>begin<br> if fsMDIForm = nil then<br> fsMDIForm := TfsMDIForm.Create(Application)<br> else<br> with fsMDIForm do<br> begin<br> BringToFront;<br> if WindowState = wsMinimized then WindowState := wsNormal;<br> end;<br>end;<br><br>另外,需要在fsMDIForm的OnClose中添加如下代码<br>fsMDIForm := nil;<br>Action := caFree;<br>