Board index » delphi » Keeping a form always on top?

Keeping a form always on top?

I've been writing a program that needs to always be the window showing on
the screen. I set the FormStyle property of the form to fsStayOnTop and
what I'm wondering is why is it that this switches periodically so that
other windows can be seen ontop of this form? I'm using delphi 2.0 and if
anyone could help it'd be appreciated.

-Pierre

 

Re:Keeping a form always on top?


Quote
ps_s...@alcor.concordia.ca (Pierre Sopel) wrote:
>I've been writing a program that needs to always be the window showing on
>the screen. I set the FormStyle property of the form to fsStayOnTop and
>what I'm wondering is why is it that this switches periodically so that
>other windows can be seen ontop of this form? I'm using delphi 2.0 and if
>anyone could help it'd be appreciated.
>-Pierre

The fsStayOnTop makes a form the topmost form of your application.
What you really need to do is use SetWindowPos(Application.Handle,
...)

Good luck,

David Block
CoStar Corporation

Re:Keeping a form always on top?


In article <4reu5r$...@newsflash.concordia.ca>,
   ps_s...@alcor.concordia.ca (Pierre Sopel) wrote:
]-I've been writing a program that needs to always be the window showing on
]-the screen. I set the FormStyle property of the form to fsStayOnTop and
]-what I'm wondering is why is it that this switches periodically so that
]-other windows can be seen ontop of this form? I'm using delphi 2.0 and if
]-anyone could help it'd be appreciated.
]-

you need a call to TApplication.RestoreTopMosts.  check
the online help for details...

Mark Vaughan

]-
]--Pierre
]-

Re:Keeping a form always on top?


I've been writing a program that needs to always be the window
showing on the screen. I set the FormStyle property of the form to
fsStayOnTop and what I'm wondering is why is it that this switches
periodically so that other windows can be seen ontop of this form?
I'm using delphi 2.0 and if anyone could help it'd be appreciated.

The fsStayOnTop property is only valid for windows that dont have
this property set, if you have two or more windows with fsStayOnTop
then they act just like normal windows allowing you to switch between
them changing which one is ontop.You can set a window by doing
(I think it is) SystemModal check it out in the help file, this will
allow only this window to be ontop and recieve focus.

HTH
Tim Hyder

Other Threads