On Thu, 08 Sep 2005 11:08:54 +0200
Bartek <[EMAIL PROTECTED]> wrote:
> Mattias Gaertner wrote:
>
> >On Sun, 07 Aug 2005 18:40:05 +0200
> >Bartek <[EMAIL PROTECTED]> wrote:
>[...]
> >>TCustomForm.ShowModal Visible=False Enabled=True fsModal=True
> >>
> >
> >You are showing the form twice. Skip the second.
> >
> >Mattias
> >
> >
> But I don't show the form twice. At least I think so. I let Lazarus
> auto-create the forms.
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?
Mattias
> I close some of the unneeded forms manually.
> [...]
> procedure Tfrm_main.Form1Show(Sender: TObject);
> begin
> nc_prog_writer:=TNCWriter.Create;
> Console.Show;
> frm_progress.close;
> frm_geo_properties.close;
> frm_nccmd_param9.close;
> frm_ncprog.show;
> sdl_win:=tsdl_win_thread.Create;
> caption:='DXF2MCR '+version;
> left:=0;
> top:=0;
> end;
> [...]
>
> Then I try to show my form modal. I don't see where I show it twice.
> Should I destroy and recreate the form before showing it modal?
You should not use 'close' on a modal form. It closes itself as soon as it
'notices' that its ModalResult is set.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives