Sorry,Try again:<br><br> Make a form Showmodal by using Show<br><br>Sometime you have a form that you would like to act like a showmodal<br>form but you would like the calling form to control it. An example<br>of this is when you are displaying a progress dialog. The problem is<br>that if you use Showmodal then all your code to perform the operation<br>must exist in the showmodal form, this is not always the desired way<br>to coding. An easy way to do this is to use DisableTaskWindows and<br>EnableTaskWindows to make your dialog act like a showmodal form but<br>at the same time allow the calling form to control the dialog.<br><br>procedure TForm1.ShowProgressDlg;<br>var<br>WindowList: Pointer;<br>begin<br> {Disables all forms except Form2}<br> WindowList := DisableTaskWindows(Form2.Handle);<br> try<br> Form2.Show;<br> {Loop that performs a task}<br> Form2.ProgressBar1.Position := Form2.ProgressBar1.Position + 1;<br> {end loop}<br> finally<br> {enable all forms again}<br> EnableTaskWindows(WindowList);<br> Form2.Close;<br> end;<br>end;<br><br>