Board index » delphi » How to get a form always on top.
Stan Megens
![]() Delphi Developer |
Fri, 19 Jul 2002 03:00:00 GMT
|
Stan Megens
![]() Delphi Developer |
Fri, 19 Jul 2002 03:00:00 GMT
How to get a form always on top.
I want to make a form that is always on top in the entire windows
environment (i.e. on top of word, excel etc). Setting FormStyle = fsStayOnTop does not do the job; if I start Word or Excel, it displays over my "StayOnTop-Form". Any solutions? Stan Megens smeg...@inter.nl.net |
Matt
![]() Delphi Developer |
Fri, 19 Jul 2002 03:00:00 GMT
Re:How to get a form always on top.Word and Excel interfering with stay on top is a new one on me... You can try this in your form to set the "OnTop" on or off. Create a variable called OnTop, to hold whether the form is on top or not, and do this to set the window state: if OnTop then Order := HWND_TOPMOST SetWindowPos( Handle, Order, Left, Top, Width, Height, (Order is type HWND). Matt Palmer QuoteStan Megens <smeg...@inter.nl.net> wrote in message Quote |
Stan Megen
![]() Delphi Developer |
Fri, 19 Jul 2002 03:00:00 GMT
Re:How to get a form always on top.Thanks, but.... This still doesn't work. Stan. Matt P <matt.pal...@{*word*269}.net> schreef in berichtnieuws Quote> Word and Excel interfering with stay on top is a new one on me... You can |
Matt
![]() Delphi Developer |
Fri, 19 Jul 2002 03:00:00 GMT
Re:How to get a form always on top.Errmm.. SetWindowPos works for me, on Win95, Win98 and NT4... What exactly are you doing. The devil's in the details, as they say. You say that you're "showing" the form - do you mean it's created but More info needed! -- Matt Palmer QuoteStan Megens <smeg...@inter.nl.net> wrote in message Quote> Thanks, but.... |
James Wes
![]() Delphi Developer |
Tue, 23 Jul 2002 03:00:00 GMT
Re:How to get a form always on top.One way is to override the CreateParams procedure in your form. ie: procedure TForm1.CreateParams( var Params: TCreateParams ); Quote"Stan Megens" <smeg...@inter.nl.net> wrote in message Quote> I want to make a form that is always on top in the entire windows |
Frank Sta
![]() Delphi Developer |
Tue, 30 Jul 2002 03:00:00 GMT
Re:How to get a form always on top.On Mon, 31 Jan 2000 12:22:48 +0100, "Stan Megens" Quote<smeg...@inter.nl.net> wrote: we talked about the StayOnTop problem last evening, so I created a new b.t.w.: If you want, we can communicate in private mail. Success, Frank. Quote>I want to make a form that is always on top in the entire windows |
Stan Megen
![]() Delphi Developer |
Tue, 30 Jul 2002 03:00:00 GMT
Re:How to get a form always on top.I started testing with a new application (form1) and of course the "stay on top" worked fine. Then I added a simple button which calls form2 (also stay on top): If I run it, it works fine, until I press the button which shows Form2. Stan Megens |
TS
![]() Delphi Developer |
Tue, 30 Jul 2002 03:00:00 GMT
Re:How to get a form always on top.If it will work for your purposes, use the ShowModal command. Form2.ShowModal; Hope this helps, Quote"Stan Megens" <smeg...@inter.nl.net> wrote in message Quote> I started testing with a new application (form1) and of course the "stay |