[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

12/1/2011 9:25:00 PM

A) From a main form frmMain

Open Window1 with frm1.Show ,me
It sits on top of the main form as expected.

From frm1 I open one form
frm2.Show , me

From frm2 I open two more forms
frm3.Show , me
frm4.Show , me

frm2 jumps behind frm1
frm3 and frm4 are in front

I want the stack they way I call it.
No windows are to be modal.
They all need to be active and move around.

B) overlapping in front should be based on the one with focus.


5 Answers

BeeJ

12/3/2011 2:12:00 AM

0

unfortunately Mesnews send the post before i finished editing it. Some
keystroke I accidentally hit???

Anyway, the problem is that one form jumps behind the form that
.Show , Me
it. WhY.

Looking at the internet resources I see that there is:
OnTop API call
I will be calling this on three forms opened from the main form if I
use this.
Is this the correct way to go?

Owner API call
How is this dfferent than the ,Me ?


ralph

12/3/2011 4:22:00 AM

0

On Fri, 02 Dec 2011 18:12:02 -0800, BeeJ <nospam@spamnot.com> wrote:

>unfortunately Mesnews send the post before i finished editing it. Some
>keystroke I accidentally hit???
>
>Anyway, the problem is that one form jumps behind the form that
> .Show , Me
>it. WhY.
>
>Looking at the internet resources I see that there is:
> OnTop API call
>I will be calling this on three forms opened from the main form if I
>use this.
>Is this the correct way to go?
>
> Owner API call
>How is this dfferent than the ,Me ?
>

Each Form has a .ZOrder property.

Windows default behavior for what Form will appear on top are
generally determinable, but who it decides is "next" or "Last" can be
a bit of a mystery at times. There are many factors which can
influence its decision - even border styles.

Any attempt to manage the .ZOrder of Forms from Forms themselves will
ultimately prove fragile and resemble cat herding. Even if you get
something working - a change in apparently unrelated sections will
often break it.

I usually create what I call myMFIM singleton class or form. (MFIM :=
Multiple Form Interface Manager.)
I use it to create, launch, display, control lifetimes, and thus
manage .ZOrder for all Forms. Makes things simpler having it all in
one place.

-ralph

BeeJ

12/5/2011 12:25:00 AM

0

so a "base" form launching other forms that launch additional forms
would all "call back" to the "base" form to instantiate and show only
those (multiple) forms needed at that moment? Interesting.

Maybe from a single sub on the "base" form that has 'select case' code
for each form that could possible be launched?



--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

BeeJ

12/6/2011 12:26:00 AM

0

I tried what you suggested and still the second form jumps behind the
base form when the third form is opened. Using just .Show and no
params.

So I tried using topmost on all forms opened after the base and this
WORKS! All three topmost forms sit on top of the base form and they
all interplay nicely with each other sharing the spotlight when
clicked.

Does this make sense?

Public Sub MakeTopmost(oForm As Form, bMakeTopmost As Boolean)

Dim lParm As Long

lParm = IIf(bMakeTopmost, HWND_TOPMOST, HWND_NOTOPMOST)

SetWindowPos oForm.hwnd, _
lParm, _
0&, _
0&, _
0&, _
0&, _
(SWP_NOACTIVATE Or SWP_SHOWWINDOW Or _
SWP_NOMOVE Or SWP_NOSIZE)

End Sub



--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

ralph

12/6/2011 2:59:00 AM

0

On Mon, 05 Dec 2011 16:26:28 -0800, BeeJ <nospam@spamnot.com> wrote:

>I tried what you suggested and still the second form jumps behind the
>base form when the third form is opened. Using just .Show and no
>params.
>
>So I tried using topmost on all forms opened after the base and this
>WORKS! All three topmost forms sit on top of the base form and they
>all interplay nicely with each other sharing the spotlight when
>clicked.
>
>Does this make sense?
>

Sure. That is pretty much Window's default for opening up new windows.

My MFIM is only useful for putting things "back" or re-arranging after
subsquent activity.

-ralph