473,789 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ 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 6804
On 10 Apr, 19:24, "Shane" <shane_n...@yah oo.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.Ow ner = 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.Sh ow(MainAppForm)

HTH.

Regards,

Branco.

Apr 11 '07 #4

On 11 Apr, 01:34, "Shane" <shane_n...@yah oo.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 YourFloatingFor m.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
3535
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 variable to mark authenticated users.
4
9905
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 Form fields visible and not cleared. Also when I display the message I want the original form cleared in a different version of this page how can I clear the form completely when I display the data entered from the Response statements I do not...
1
2968
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 part (stlinkcriteria) - but how do I have the new form open on the record that was current in the datasheet form? I don't want to filter to the current record when the 2nd form opens - I would like to be able to keep the whole rs and be able to...
3
6351
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 to keep those variables, as an alternative, as ViewState variables because I don't want to transfer to many hidden fields. This is the code I use :
4
2211
by: Rob | last post by:
Is there a way to keep a form on top of everything - even other apps ?
10
7244
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 within results.php, MySQL structure seems to work as expected, although i get some problems: As soon as i click on the "Page 2" Link, i get nothing, neither results nor page numbers.
14
3708
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 program from running through the sub main code and then closing without ever firing the timer? I can put Do While 3 <> 2 Loop
11
9309
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, y1, x2, y2); }
0
1839
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 "file". That mean I create server file upload controls in this page. After user choose their files, wanted to upload, and click upload button, this page will be postbacked to another page, called "edit.aspx". The code as follows. edit.aspx
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10410
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.