473,324 Members | 2,548 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,324 software developers and data experts.

How to set level/depth/Z-value of non-modal popup forms?

I have a need to arrange the relative depth of several non-modal popup
forms. Specifically, I need to make sure one particular form is
always at the back of the others. That is, if a user happens to click
on the "background" form (which would normally bring that form to the
front), I want to execute code that would immediately send that form
to the "back-most" position.

I believe that, in general, in working with layered windows in any
system, the property I am speaking of is called something like the "Z-
value," but I do not know how to reference it in Access forms or
whether it can be set programmatically via Windows API or some other
means.

I know that it is easy to accomplish this if only two forms are
involved, by setting focus to the form-that-needs-to-be-on-top
whenever the form-that-needs-to-be-on-the-bottom is clicked. In this
particular app I will have many forms displayed at once, and setting
focus to a single form means that ONLY that form will then be in front
of the background form.

I also know that if the background form were not set to "popup" this
would not be a problem, but I need it to be popup so that I can
maximize it to take over the entire screen, hiding all the Access
menus and toolbars.

Thanks!

Aug 5 '07 #1
4 2153
if the only thing you're using that form for is to "hide" the Access window
menu bar(s) and toolbar(s), it might be easier to just get rid of them
entirely.

hth
<ks***@yahoo.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
I have a need to arrange the relative depth of several non-modal popup
forms. Specifically, I need to make sure one particular form is
always at the back of the others. That is, if a user happens to click
on the "background" form (which would normally bring that form to the
front), I want to execute code that would immediately send that form
to the "back-most" position.

I believe that, in general, in working with layered windows in any
system, the property I am speaking of is called something like the "Z-
value," but I do not know how to reference it in Access forms or
whether it can be set programmatically via Windows API or some other
means.

I know that it is easy to accomplish this if only two forms are
involved, by setting focus to the form-that-needs-to-be-on-top
whenever the form-that-needs-to-be-on-the-bottom is clicked. In this
particular app I will have many forms displayed at once, and setting
focus to a single form means that ONLY that form will then be in front
of the background form.

I also know that if the background form were not set to "popup" this
would not be a problem, but I need it to be popup so that I can
maximize it to take over the entire screen, hiding all the Access
menus and toolbars.

Thanks!

Aug 5 '07 #2
On Aug 5, 9:23 pm, "tina" <nos...@address.comwrote:
hmm, okay. you might try adding code to the "background" form's Activate
event procedure, to select another open form, using DoCmd.SelectObject. if
there's one that's always open, just select that form. if not, you can loop
through the forms collection, checking for open forms, and select the first
form that *is* open (other than the background form, of course).
I have tried something similar to this, setting focus to a known open
form, but that leaves only that single form exposed in front of the
background. Any other open forms remain behind the background. I
knew that one solution would be to loop through the forms, detecting
the open ones, and setting focus (or, as you suggest, SelectObject) to
each form in turn, which would place them all in front of the
background -- and this may well be the approach I am forced to take.

I was only hoping there was a far simpler and faster way of just
moving the background back where it belongs, which would have the
added benefit of leaving all the forms untouched and in their existing
orientation. (That is, if the user had arranged them in some
overlapping pattern, their relative depths would remain unchanged.)

Aug 6 '07 #3
tina,

It took a little digging (er, googling), but the call to SetWindowPos
(using hWndInsertAfter equal to constant HWND_BOTTOM and FLAG equal to
SWP_NOACTIVATE) did the trick. Works great! Exactly what I was
hoping for -- and more. SetWindowPos is a very useful API call to
know about and I am sure I will find other uses for it as well.

SetWindowPos is described here:

http://msdn2.microsoft.com/en-us/library/ms633545.aspx

Thanks so much!

Aug 6 '07 #4
oh, cool, i'm glad Tom's post was able to help you out! and you're very
welcome :)
<ks***@yahoo.comwrote in message
news:11**********************@e16g2000pri.googlegr oups.com...
tina,

It took a little digging (er, googling), but the call to SetWindowPos
(using hWndInsertAfter equal to constant HWND_BOTTOM and FLAG equal to
SWP_NOACTIVATE) did the trick. Works great! Exactly what I was
hoping for -- and more. SetWindowPos is a very useful API call to
know about and I am sure I will find other uses for it as well.

SetWindowPos is described here:

http://msdn2.microsoft.com/en-us/library/ms633545.aspx

Thanks so much!

Aug 7 '07 #5

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

Similar topics

4
by: Shawn Brock | last post by:
This is a wildly broad question, so apologies in advance. I developed a very traditional app architecture in Visual Studio 5-6. The basic structure looked like this: GUI >> MTS >> Database The...
3
by: Amit | last post by:
Greetings All. One of the usages that I need is accessing the contents of the container that I am using in level order( which would mean breadth- first search approach for a binary tree) as...
11
by: seannakasone | last post by:
Is there a way to get the callstack level in c++? for example, take the following code: void call3() { //callstack level would be 3 } void call2() { //callstack level would be 2 call3();
2
by: pengbsam | last post by:
Hello: I need to write a program that search through multiple level BOM, get all the items. It seems like a easy enough project, but when I put my hands on it and couple of hundred lines of codes...
3
by: David Bear | last post by:
Is there an easy way to get the current level of recursion? I don't mean sys.getrecursionlimit. I want to know during a live run of a script how many times the functions has recursed -- curses, I...
1
by: Gary Wessle | last post by:
Hi is there some guide lines on how many level deep once can structure the inheritance, I have 3 level deep inheritance setup and just wondering whether this is the norm? each level is...
8
by: darrel | last post by:
I've decided that instead of doing an XSLT transformation on a file, I might be better off bringing it in as a dataset and having a bit more direct control over it at that point. The question I...
1
by: Bllich | last post by:
can anyone post an algoritam for the deepest level of a treeView ? it should be a recursive function I think.. I don't need treeView.Nodes.Level because my users don't select the nodes... I...
2
by: Gentr1 | last post by:
Hi everybody! I am presently working on a Genetic Programming API in python. I have a bit of a problem at the moment... For some specific reasons, I am using nested lists data structure to...
8
by: APEJMAN | last post by:
hI Would you please help me with this question? Using Big O Notation, what is the running time of the level-order traversal ( the code below) in terms of the number of nodes N and the tree height...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.