Board index » delphi » Normal->MDI->Normal ????

Normal->MDI->Normal ????

Quote
Michael Zeltsers <michae...@prodmail.rad.co.il> wrote:
>I have some very strange problem.
>There are two forms in my test project : Main and About, I call About
>from the Main by about.ShowModal.
>First, I set the propety FormStyle of the forms to fsNormal. It works
>without any surprises. Second, I set the property to fsMDIForm for Main
>and MDIChild for About. It works too, without any surprises.
>Finally I set the property back to the fsNormal for both forms,
>and from now the forms are going crasy. I see, that About form are
>opened too, and if I try call About from Main I have an error:
>"Cannot make a visible window modal"
>All my changes were only in property FormStyle from normal to MDI and
>back to the normal, without any letter of code.
>It make place in D1 and D2.

Had a similar problem some time ago.
The cause is, that the FormStyle property has a side-effect on
the Visible property (which is false by default on all forms except
MDI-child forms. On all other forms, this property is set true at
Show or ShowModal time).
So switching from fsNormal to fsMDIChild also sets Visible to true.
Unfortunatly it's not reset to false if you switch from fsMDIChild
back to fsNormal, so you have to do this by hand...

--
Matthias Gerstgrasser
m...@sbox.tu-graz.ac.at

 

Re:Normal->MDI->Normal ????


I have some very strange problem.
There are two forms in my test project : Main and About, I call About
from the Main by about.ShowModal.
First, I set the propety FormStyle of the forms to fsNormal. It works
without any surprises. Second, I set the property to fsMDIForm for Main
and MDIChild for About. It works too, without any surprises.
Finally I set the property back to the fsNormal for both forms,
and from now the forms are going crasy. I see, that About form are
opened too, and if I try call About from Main I have an error:
"Cannot make a visible window modal"

All my changes were only in property FormStyle from normal to MDI and
back to the normal, without any letter of code.
It make place in D1 and D2.

My be sombody can explain me what does it mean, and how can I fix it,
without code changes.

Thanks,
Michael

Re:Normal->MDI->Normal ????


Quote
On Wed, 28 Aug 1996, Michael Zeltsers wrote:
> I have some very strange problem.
> There are two forms in my test project : Main and About, I call About
> from the Main by about.ShowModal.
> First, I set the propety FormStyle of the forms to fsNormal. It works
> without any surprises. Second, I set the property to fsMDIForm for Main
> and MDIChild for About. It works too, without any surprises.
> Finally I set the property back to the fsNormal for both forms,
> and from now the forms are going crasy. I see, that About form are
> opened too, and if I try call About from Main I have an error:
> "Cannot make a visible window modal"

> All my changes were only in property FormStyle from normal to MDI and
> back to the normal, without any letter of code.
> It make place in D1 and D2.

> My be sombody can explain me what does it mean, and how can I fix it,
> without code changes.

> Thanks,
> Michael

While changing the FormStyle from fsNormal to fsMDIChild, the project file
<project name>.dpr
is changed. If you change it again to fsNormal, the .dpr file is
NOT CHANGED BACK automatically.

Hope this is a help
Peter

----------------------------------------------------------------
Peter Dauscher              email: dausp...@mail.uni-mainz.de  
Institut fuer Physik        Tel:  06131 / 39-5171   (Uni)
WA Nichtlineare Dynamik           06731 / 3035      (privat)
Universitaet Mainz
----------------------------------------------------------------

Other Threads