473,466 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Keep a form on top of the app only

How do you keep a form on top of an application only.

I know that I can use "TopMost" to keep a form on top of the other
forms, but that solution is Windows scope instead of only my
application scope.

I have a floating "Totals" screen (among others) so that a user can
see which checks will print, total receipts, and other items. They can
resize the form, and move it anywhere on the screen, so creating a
dock area on the screen is not an option.

If my program loses focus, the "Totals" form stays on the screen.
Obviously, that's a bit of a problem when the user goes into Outlook
or something.

If there is no command to make a "Topmost" only applicable to a single
program instead of system wide, is there a way to tell when my
application loses focus? I could check an event and hide any floating
forms.

Thanks.

Apr 10 '07 #1
5 6789
On 10 Apr, 19:24, "Shane" <shane_n...@yahoo.comwrote:
How do you keep a form on top of an application only.

I know that I can use "TopMost" to keep a form on top of the other
forms, but that solution is Windows scope instead of only my
application scope.

I have a floating "Totals" screen (among others) so that a user can
see which checks will print, total receipts, and other items. They can
resize the form, and move it anywhere on the screen, so creating a
dock area on the screen is not an option.

If my program loses focus, the "Totals" form stays on the screen.
Obviously, that's a bit of a problem when the user goes into Outlook
or something.

If there is no command to make a "Topmost" only applicable to a single
program instead of system wide, is there a way to tell when my
application loses focus? I could check an event and hide any floating
forms.

Thanks.
have you tried if you can solve with the "owner" property?

TotalsScreen.Owner = FormUnderneath

-P

Apr 10 '07 #2
I don't really understand your reply Pamela.

If I show the form on the parent, which I do, and the Totals form is
not set to Topmost, the Totals form will be hidden under the parent
form as soon as a control (textbox) gets focus on the parent control.

Shane

Apr 10 '07 #3
Shane wrote:
How do you keep a form on top of an application only.
<snip>

Use

FloatingForm.Show(MainAppForm)

HTH.

Regards,

Branco.

Apr 11 '07 #4

On 11 Apr, 01:34, "Shane" <shane_n...@yahoo.comwrote:
I don't really understand your reply Pamela.

If I show the form on the parent, which I do, and the Totals form is
not set to Topmost, the Totals form will be hidden under the parent
I do not not exactly your situation. I usually use
owner / show (not showdialog) to keep a form always on top of another
and
be free to move it.
Another solution would be to define it as a form contained in a
control
by setting YourFloatingForm.TopLevel = False.

So I am guessing it can work for you too.

The owned form cannot go under the owner (a owner is a "special"
parent) form.

-P

form as soon as a control (textbox) gets focus on the parent control.

Shane

Apr 11 '07 #5
That worked great.

Thanks

Apr 11 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Hung Huynh | last post by:
Hello, I have 2 separate web sites on 2 different boxes www.xyz.com on box 1 www2.xyz.com on box 2 Users log into box 1 via regular ASP/Database authentication, and I keep a session...
4
by: karenmiddleol | last post by:
I have the following form the user enters the From and to period and presses the Submit button and the form fields are cleared once the submit button is pressed. Is there a way I can keep the...
1
by: 4004 | last post by:
I would like to open a columnar form (so I can see all the details) from a datasheet form (so I can see what is there) but keep the same recordset and current record. I can do the recordset set...
3
by: Paul | last post by:
Hello, First I want to refer to the problem "WebRequest : execute a button" of a few days ago. The way I solved it, I loose my session, and as a consequence my session variables. I don't want...
4
by: Rob | last post by:
Is there a way to keep a form on top of everything - even other apps ?
10
by: EOZyo | last post by:
Hi, i'm trying to set pagination for a search i run on my website, i'll try to explain the easiest i can: When i click the search button on search.php, data is received and stored in variables...
14
by: William LaMartin | last post by:
If I have a Windows application with no form--only a module that starts with sub main and which has a system timer, in the elapsed event of which I want to run some code, how can I keep this...
11
by: cty0000 | last post by:
I have some quiestion... I want to draw line,point,rectangles and etc... on the from So I code like this.. public update() { g = this.CreateGraphics(); g.FillRectangle(Brushes.White, x1,...
0
JimWu
by: JimWu | last post by:
I have some problems in my code. The stutiation illustrate as the followsing statement. I use two pages, one, named "upload.aspx", is including several general html input tag, whose type are...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.