On Fri, 09 Sep 2005 14:19:14 +0200 Bartek <[EMAIL PROTECTED]> wrote: >[...] > > TCustomForm.ShowModal is the only method, that sets fsModal. You got the > > exception, because the fsModal was already set, so ShowModal was called > > twice. > > You are showing the form in a timer. Maybe the you forgot to disable the > > timer in OnTimer? > > I did not know that I had to do this. Thanks for the help, now it works > perfect. > But now I am somehow confused. I thought that the ShowModal call > stalls the execution of OnTimer. Now I am not sure how this works. Is > the OnTimer proc called in a separate thread? Otherwise it would not be > able to call ShowModal once more.
OnTimer runs in the same thread. ShowModal creates a new event loop, that means all events are still triggered, and thus all timers still work. The main loop in TApplication is stopped and thus the application does not terminate before the modal form stops. Mattias _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives