Discussion:
Cannot make a visible window modal error
(too old to reply)
Larry Maturo
2005-06-15 22:01:28 UTC
Permalink
I was working with a new form I created, and all was going well. I added
one more button to the form, compiled, and ran the application, and when I
invoke the form
I get this error message: "Cannot make a visible window modal". It's no
more
visible than it was before I added the button. :-) Any idea what happened?
By the way, I did double check that the forms visibility was set to false in
the object,
inspector just to make doublely sure it was created invisiblely, and it was.

-- Larry Maturo
Larry Maturo
2005-06-15 22:12:48 UTC
Permalink
One more bit of info. I broke on the ShowModal line in the dubgger,
and checked the Visible attribute of the form I had just created., and
Visible was set to false. That means when it executes the ShowModal
the form has got to be "invisible". This makes the error message even
harder to figure out.

Oh, and if it makes a difference, this in Delphi 7.

-- Larry Maturo
Post by Larry Maturo
I was working with a new form I created, and all was going well. I added
one more button to the form, compiled, and ran the application, and when I
invoke the form
I get this error message: "Cannot make a visible window modal". It's no
more
visible than it was before I added the button. :-) Any idea what
happened? By the way, I did double check that the forms visibility was set
to false in the object,
inspector just to make doublely sure it was created invisiblely, and it was.
-- Larry Maturo
Larry Maturo
2005-06-15 22:33:58 UTC
Permalink
Hi Rudy,

Thank you. Somehow enabled got set to false. Setting it to true fixed the
problem.
I much appreciate the help.

-- Larry Maturo
Post by Larry Maturo
I was working with a new form I created, and all was going well. I
added one more button to the form, compiled, and ran the application,
and when I invoke the form
I get this error message: "Cannot make a visible window modal". It's
no more
visible than it was before I added the button. :-) Any idea what
happened? By the way, I did double check that the forms visibility was
set to false in the object,
inspector just to make doublely sure it was created invisiblely, and it was.
-- Larry Maturo
function TCustomForm.ShowModal: Integer;
// <snip>
begin
CancelDrag;
if Visible or not Enabled or (fsModal in FFormState) or
(FormStyle = fsMDIChild) then
raise EInvalidOperation.Create(SCannotShowModal);
One of these conditions must have applied.
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de
"A good sermon should be like a woman's skirt: short enough to arouse
interest but long enough to cover the essentials." -- Ronald Knox.
Rudy Velthuis [TeamB]
2005-06-15 22:40:30 UTC
Permalink
Post by Larry Maturo
I much appreciate the help.
I'm glad about that, but next time, please try to tell me so without
quoting 30 lines.
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de

"I still live." - Daniel Webster, dying words
Rudy Velthuis [TeamB]
2005-06-15 22:32:11 UTC
Permalink
Post by Larry Maturo
I was working with a new form I created, and all was going well. I
added one more button to the form, compiled, and ran the application,
and when I invoke the form
I get this error message: "Cannot make a visible window modal". It's
no more
visible than it was before I added the button. :-) Any idea what
happened? By the way, I did double check that the forms visibility was
set to false in the object,
inspector just to make doublely sure it was created invisiblely, and it was.
-- Larry Maturo
function TCustomForm.ShowModal: Integer;
// <snip>
begin
CancelDrag;
if Visible or not Enabled or (fsModal in FFormState) or
(FormStyle = fsMDIChild) then
raise EInvalidOperation.Create(SCannotShowModal);

One of these conditions must have applied.
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de

"A good sermon should be like a woman's skirt: short enough to arouse
interest but long enough to cover the essentials." -- Ronald Knox.
Loading...