在Idle过程中检测<br>procedure TForm1.MyIdleHandler(Sender: TObject; var Done: Boolean);<br>begin<br> if ActiveMDIChild <> nil then<br> ToolBar1.Visible := True;<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> ...<br> Application.OnIdle:= MyIdleHandler;<br> ...<br>end;<br><br><br>