Board index » delphi » "Cannot make a visible window modal"

"Cannot make a visible window modal"

when I call the function "Form1.ShowModal", it works at the first time.
After I close the form, I try to call it the second time, and I got a error
msg "Cannot make a visible window modal".

What was I doing wrong and how to solve it?

--
Thanks!
-----------------------
Haizheng Sun

 

Re:"Cannot make a visible window modal"


In article <3dc3f61...@newsgroups.borland.com>, "Dave Davis"

Quote
<newsp...@30west.net> wrote:
> Now I'm confused.  If I don't call an automatically created form with show
> or show modal, what is the proper way to show, or show modally a form that
> is automatically created?

Forms which will appear modally should *never* be autocreated, since these
resources are only needed while they are actually being used.

Some may say that *only* the main form should be autocreated, but if you
have several important forms which may appear non-modally and which will
surely be needed in every run, so want to autocreate them, I'd Hide them
when they were 'closed' (not really closed but it looks that way to the
user) and set them visible again when next needed. (You might also have to
restore them if they are minimised when they are recalled).

-Iain.

Re:"Cannot make a visible window modal"


On 04 Nov 2002, "Iain Macmillan" <h...@ariesps.co.uk> wrote:

Quote
> Forms which will appear modally should *never* be autocreated, since
> these resources are only needed while they are actually being used.

If you have a modal form that is shown many times and is expensive to
create it makes sense to autocreate it.  Yes, the resources are still used
when the form is not shown but that might be a reasonable tradeoff if
you're trying to save time.

--
-Mike (TeamB)

Re:"Cannot make a visible window modal"


In article <Xns92BC6C737BC28mikewte...@207.105.83.65>, "Mike Williams

Quote
(TeamB)" <mi...@remove.aps-soft.com> wrote:
>> Forms which will appear modally should *never* be autocreated, since
>> these resources are only needed while they are actually being used.

> If you have a modal form that is shown many times and is expensive to
> create it makes sense to autocreate it.  Yes, the resources are still used
> when the form is not shown but that might be a reasonable tradeoff if
> you're trying to save time.

> --
> -Mike (TeamB)

yes, fair point Mike. When I say *never*, I mean
'*never* (unless you have a very good reason)'
 .. rules are made for breaking <g>.

Other Threads