Stay on top

Hi,
i got two Forms. Every has the property fsStayOnTop.
Form1 is show Form2 and Form1.Hide.
Form2 is show Form1 and Form2.Hide.
So that only one of the two Forms is visible.
BUT: When Form2 is showing Form1, Form1 is no longer "fsStayOnTop"!
Can anyone help me?
bye
haehnenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

philipleighsCommented:
Maybe just before you close a form, you should set it to fsNormal?
And just before you show it again, set it to fsStayOnTop?

Just an idea.

Cheers,
Phil.

0
haehnenAuthor Commented:
Hi,
that's not work!
bye
0
FelixinCommented:
This comes from the Delphi help:

fsStayOnTop      
This form remains on top of the desktop and of other forms in the project, except any others that also have FormStyle set to fsStayOnTop. If one fsStayOntop form launches another, neither form will consistently remain on top.

and

Note:      It is not advisable to change FormStyle at runtime.

I checked changing the FormStyle property at run time at it doesn't work, as you said.

Further investigation needed.

Sorry.

Felixin
0
haehnenAuthor Commented:
Hi,
here is the Code(in a OnMouseOverEvent):
Form4.Height := 71; //make Form4.visible:=False
Form4.Width := 239; //
Form3.Height := 0;  //make Form3.Visible:=True
Form3.Width := 0;

Form4 and Form3 have fsStayOnTop.
any Questions?
bye

0
zekoCommented:
When you want to display forms try
Form2.ShowModal; not Form2.Show;
Maybe this will help.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.