473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Windows, forms and ALWAYS-ON-TOP

I have a problem with windows in my VB projects.

My project consists of an MDI form with many child (MDIChild = TRUE)
and non-child (MDIChild = FALSE) forms contained within.

The problem I have is making a form stay on top when it loses the
focus to the main MDI form without setting it ALWAYS-ON-TOP.
ALWAYS-ON-TOP keeps the form at the top even when I switch tasks to
another running program (pain in the butt because then I can't see
what I want to see). And if I don't make the form ALWAYS-ON-TOP, then
clicking on the main MDI form makes the window I want to see all the
time go away (when it loses focus). How do I keep my non-child windows
still appearing "on top" even when they lose the focus? I've seen
other programs do this and it must be a system thing because there is
no special code in the forms that I have seen to account for this (the
MDIChild is set to FALSE and there is no code in the activate,
deactivate, got_focus or lost_focus events).

Thank you.

---
Allen

Jul 17 '05 #1
2 14443
From a post by Jeff Johnson:

"You have posted this question individually to
multiple groups. This is called Multiposting
and it's BAD. Replies made in one group will
not be visible in the other groups, which
may cause multiple people to respond to your
question with the same answer because they
didn't know someone else had already done it.
This is a waste of time.

If you MUST post your message to multiple
groups, post a single message and select all
the groups (or type their names manually,
separated by commas) in which you want it to
be seen. This is called Crossposting and when
used properly it is GOOD."

Rick - MVP
"Woof-Woof" <ot*********@cox.net> wrote in message
news:hremc.8799$%o1.7744@lakeread03...
I have a problem with windows in my VB projects.

My project consists of an MDI form with many child (MDIChild = TRUE)
and non-child (MDIChild = FALSE) forms contained within.

The problem I have is making a form stay on top when it loses the
focus to the main MDI form without setting it ALWAYS-ON-TOP.
ALWAYS-ON-TOP keeps the form at the top even when I switch tasks to
another running program (pain in the butt because then I can't see
what I want to see). And if I don't make the form ALWAYS-ON-TOP, then
clicking on the main MDI form makes the window I want to see all the
time go away (when it loses focus). How do I keep my non-child windows
still appearing "on top" even when they lose the focus? I've seen
other programs do this and it must be a system thing because there is
no special code in the forms that I have seen to account for this (the
MDIChild is set to FALSE and there is no code in the activate,
deactivate, got_focus or lost_focus events).

Thank you.

---
Allen


Jul 17 '05 #2
I'm sorry.

Here is the solution:

when you show the form use the optional owner argument:

<nonchildform>.Show vbModeless, <mdiform>
--
---
Allen

"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:Tb********************@comcast.com...
From a post by Jeff Johnson:

"You have posted this question individually to
multiple groups. This is called Multiposting
and it's BAD. Replies made in one group will
not be visible in the other groups, which
may cause multiple people to respond to your
question with the same answer because they
didn't know someone else had already done it.
This is a waste of time.

If you MUST post your message to multiple
groups, post a single message and select all
the groups (or type their names manually,
separated by commas) in which you want it to
be seen. This is called Crossposting and when
used properly it is GOOD."

Rick - MVP
"Woof-Woof" <ot*********@cox.net> wrote in message
news:hremc.8799$%o1.7744@lakeread03...
I have a problem with windows in my VB projects.

My project consists of an MDI form with many child (MDIChild = TRUE) and non-child (MDIChild = FALSE) forms contained within.

The problem I have is making a form stay on top when it loses the
focus to the main MDI form without setting it ALWAYS-ON-TOP.
ALWAYS-ON-TOP keeps the form at the top even when I switch tasks to another running program (pain in the butt because then I can't see
what I want to see). And if I don't make the form ALWAYS-ON-TOP, then clicking on the main MDI form makes the window I want to see all the time go away (when it loses focus). How do I keep my non-child windows still appearing "on top" even when they lose the focus? I've seen
other programs do this and it must be a system thing because there is no special code in the forms that I have seen to account for this (the MDIChild is set to FALSE and there is no code in the activate,
deactivate, got_focus or lost_focus events).

Thank you.

---
Allen

Jul 17 '05 #3

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

Similar topics

2
by: Greg Bacchus | last post by:
Hi, I'm getting an exception that really has me stumped. It's sporadic at best, it's only happened a handful of times. This particular time it happened when the user pressed 'Alt-S' to save the...
3
by: Scott | last post by:
I have written windows applications using MFC for several years and have frequently used MFC techniques. Now I'm moving to C# .NET WinForm. Mostly C# books describes C# language (sometimes...
5
by: Richard Steele | last post by:
I have created a WinForm application that needs to be run as a windows service (the PC is inaccesible by any user) i have successfully installed the application as a windows service. When i start...
11
by: DW | last post by:
I've gotten this question a couple of times in interviews and I don't know what they are looking for: How do you update a control's property, such as a textbox.text property, from a thread, in...
7
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception:...
8
by: Zeno Lee | last post by:
What is the best way to return an exit code from a VB.NET windows forms app? My Forms application is dual purpose. It is an interactive windows app. It is also automated and run via a script and...
3
by: TheSteph | last post by:
Using : VS 2005, .NET 2.0, Windows Form, Win 2k I have a strange problem in VS : When I open some forms all the files (resx and cs) of this form are immediately marked as modified (an *...
69
by: Peter Olcott | last post by:
Does JavaScript represent its controls internally as Microsoft Windows controls, or does it build them from scratch like Java?
18
by: jello_world | last post by:
I am a VB6 programmer and I know how to build console apps.. I just dont understand how to get my mind around WinForms; they just seem a lot more complex than VB6. Thanks -Charlie
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.