473,396 Members | 1,813 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,396 software developers and data experts.

The Concept of Top Most, how useful is it really?

I have a scenario that is to be totally honest, doing my Gnads in. The only
control I have over window Z ordering in VB.NET is by using "TopMost=True",
or "TopMost=False". There is no "z-order" concept that I can play with
apart from this single binary choice.

Now, think about where it might be useful to have fine grained control over
Z order: I have a main form, which pops up modeless "property" windows. I
want these property windows to remain in front of the main form because
otherwise it might be easy for a user to "lose one" behind the main form. I
also run a thread that needs to pop up a modal progress bar every now and
then. I want this to be top most of course when it's running, but I don't
want it to be topmost if I need to display an error form or message of some
kind while the thread is running, I want the error form to be topmost.
When the user presses F1 for help, I obviously want the help to be topmost.
I do not want any of my windows to remain topmost when the user launches
another process.

Now this might seem like a complex scenario, but in fact I think it's
probably a fairly common one. I'm not comfortable with piddling about with
the topmost property continually to micro-manage form visibility, when I
should simply be able to give a number on a form property that gives some
kind of Z order priority to each of my forms, relative to my executable.

Any ideas on how to manage these situations? TopMost does exactly what it
says on the tin, unfortunately!


Nov 21 '05 #1
4 3705

"Robin Tucker" <un********@duetospam.com> wrote in message
news:dg*******************@news.demon.co.uk...
|I have a scenario that is to be totally honest, doing my Gnads in. The
only
| control I have over window Z ordering in VB.NET is by using
"TopMost=True",
| or "TopMost=False". There is no "z-order" concept that I can play with
| apart from this single binary choice.

| Now this might seem like a complex scenario, but in fact I think it's
| probably a fairly common one. I'm not comfortable with piddling about
with
| the topmost property continually to micro-manage form visibility, when I
| should simply be able to give a number on a form property that gives some
| kind of Z order priority to each of my forms, relative to my executable.

i understand your frustration. it can be done but i'd recommend the
following first:

you could think about making your main form an mdi form wherein the
other/child forms will be displayed and *never* go behind it. second, your
progress bar form should be set to topmost and your error handler form
should also. the error form will *always* be the most recent form displayed
and therefore the topmost visible. i don't see *any* micro-managing at all.
that type of management *would* be needed if you *did* start to set the
z-order of windows...you'd need a scheme/algorhythm to discover the
appropriate order to set for *every* window. how you open the forms too, is
very important...i.e. i'd open the error form as dialog (a.k.a.
form.showdialog() ) while the progress bar form should *only* be shown
(form.show() ).

if you don't want to go the mdi-route, you could use a combination of
topmost and/or show/showdialog with all your forms to get the results you
require.

i do agree that a bit more suffistication with window layering would be
nice, but this only comes to my mind as problematic under *far* more complex
ui contraints that the bulk of developers will never know...and, i've only
run across 2 occasions in 15 years of programming...both resolved more
easily through other means than tinkering with z-order.

hth,

me
Nov 21 '05 #2
Robin Tucker wrote:
the topmost property continually to micro-manage form visibility, when I
should simply be able to give a number on a form property that gives some
kind of Z order priority to each of my forms, relative to my executable.


Why don't you do exactly that!! Create an Extender Provider that will
add a ZOrder property to your forms. Then in the form's constructor,
call the SetWindowPos api to set the ZOrder. It shouldn't be too
difficult.

Nov 21 '05 #3
Hmmmm thanks for the tip. I think I will ;)

"Chris Dunaway" <du******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Robin Tucker wrote:
the topmost property continually to micro-manage form visibility, when I
should simply be able to give a number on a form property that gives some
kind of Z order priority to each of my forms, relative to my executable.


Why don't you do exactly that!! Create an Extender Provider that will
add a ZOrder property to your forms. Then in the form's constructor,
call the SetWindowPos api to set the ZOrder. It shouldn't be too
difficult.

Nov 21 '05 #4
If you do, you might submit it to CodeProject as an article or MSDN or
something. at least post the solution here!

Nov 21 '05 #5

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

Similar topics

6
by: Sergey | last post by:
Hello! Could anybody be kind enough to explain this concept? Why C++ make two ops for prefix and postfix ++ operator? As I guess, it is possible to implement both cases via sole prefix...
3
by: Ramza Brown | last post by:
I have this concept I throwing together. It is not professional or anything, just something I thought might be interesting. The concept is business(me) - to - consumer. It is, What did you buy?....
27
by: Servé Lau | last post by:
in what fields of computing is C used the most nowadays? embedded, scientific, applications? What?
4
by: jm | last post by:
Consider: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconwhenshouldiimplementinterfacesinmycomponent.asp // Code for the IAccount interface module. public...
1
by: omar | last post by:
im migrating from asp to asp.net. im a bit confused about form authentication in ASP.NET ... in ASP if I wanted to create a login application I would simply query the db for the username and...
26
by: A.M | last post by:
Hi, I am new to Python, with C#/Java background Is there any built-in Hash implementation in Python? I am looking for a container that I can access to it's items by name. Something...
4
by: Matt Kruse | last post by:
Some libraries go a little overboard (IMO) extending javascript's built-in types (of course, extending Object is bad). But extending String, Array, Number, Function with useful methods can make...
8
by: Lothar Behrens | last post by:
Hi, I am thinking about using classes to encapsulate threads for my application. My requirements are the following: The thread implementation sould not know what has to be implemented in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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.