"Peter Foot [MVP]" <feedback@no-spam.inthehand.com> wrote in message
news:ul%23WSajxEHA.2676@TK2MSFTNGP12.phx.gbl...
> You can use the technique described here to make your messagebox dialog
> always appear at the top of the z-order until it is dismissed:-
> http://blog.opennetcf.org/pfoot/#a11ad82c3-a428-4aac-959f-27c9c3590662

Peter,

You say, this works until the form is "dismissed". How do you dismiss the
form? I've converted the code you provided me with that for VB.

I'm using a Me.Close to close my form.

The first time the form appears, it stays up as I was hoping it would, not
getting hidden behind other forms. But the second and beyond time it is
called, its not going away, ever. I can tell that the form in the
background is still running as I can touch buttons, at least the part of the
buttons I can see behind my 'modal' form, and they work.

Any ideas?

Re: Z-order top using SetWindowsPos by Wapiti

Wapiti
Wed Nov 10 14:37:16 CST 2004

Well, I think I have this figured out, but not sure what to do.

I call this frmMsgBox form quite a few places, so rather than instantiate it
each time, I do it once in a global module.
Public fMsgBox As New frmMsgBox

If I instantiate it each and every time I call it, rather than using this
public form variable, it works.

am I doing something stupid here (again?). How else would I make this form
callable from multiple location, in a lot of places, without having to
instantiate it all the time?

Thanks for any help.


"Wapiti" <wapiti@noplaceforspam.com> wrote in message
news:OAqLiM2xEHA.1392@tk2msftngp13.phx.gbl...
> "Peter Foot [MVP]" <feedback@no-spam.inthehand.com> wrote in message
> news:ul%23WSajxEHA.2676@TK2MSFTNGP12.phx.gbl...
> > You can use the technique described here to make your messagebox dialog
> > always appear at the top of the z-order until it is dismissed:-
> > http://blog.opennetcf.org/pfoot/#a11ad82c3-a428-4aac-959f-27c9c3590662
>
> Peter,
>
> You say, this works until the form is "dismissed". How do you dismiss the
> form? I've converted the code you provided me with that for VB.
>
> I'm using a Me.Close to close my form.
>
> The first time the form appears, it stays up as I was hoping it would, not
> getting hidden behind other forms. But the second and beyond time it is
> called, its not going away, ever. I can tell that the form in the
> background is still running as I can touch buttons, at least the part of
the
> buttons I can see behind my 'modal' form, and they work.
>
> Any ideas?
>
>



Re: Z-order top using SetWindowsPos by Peter

Peter
Wed Nov 10 14:42:44 CST 2004

If the form lives on through your app and you've overridden it to stay at
the front it will, unless you step in and change the behaviour, when you
want to hide the form call SetWindowPos again but this time either set
HWND_BOTTOM or hide or resize the form so it's no longer visible.
Then you'll have to set it top-most again when you want to show another
message.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

"Wapiti" <wapiti@noplaceforspam.com> wrote in message
news:%23Fd0LS2xEHA.2348@TK2MSFTNGP12.phx.gbl...
> Well, I think I have this figured out, but not sure what to do.
>
> I call this frmMsgBox form quite a few places, so rather than instantiate
> it
> each time, I do it once in a global module.
> Public fMsgBox As New frmMsgBox
>
> If I instantiate it each and every time I call it, rather than using this
> public form variable, it works.
>
> am I doing something stupid here (again?). How else would I make this
> form
> callable from multiple location, in a lot of places, without having to
> instantiate it all the time?
>
> Thanks for any help.
>
>
> "Wapiti" <wapiti@noplaceforspam.com> wrote in message
> news:OAqLiM2xEHA.1392@tk2msftngp13.phx.gbl...
>> "Peter Foot [MVP]" <feedback@no-spam.inthehand.com> wrote in message
>> news:ul%23WSajxEHA.2676@TK2MSFTNGP12.phx.gbl...
>> > You can use the technique described here to make your messagebox dialog
>> > always appear at the top of the z-order until it is dismissed:-
>> > http://blog.opennetcf.org/pfoot/#a11ad82c3-a428-4aac-959f-27c9c3590662
>>
>> Peter,
>>
>> You say, this works until the form is "dismissed". How do you dismiss
>> the
>> form? I've converted the code you provided me with that for VB.
>>
>> I'm using a Me.Close to close my form.
>>
>> The first time the form appears, it stays up as I was hoping it would,
>> not
>> getting hidden behind other forms. But the second and beyond time it is
>> called, its not going away, ever. I can tell that the form in the
>> background is still running as I can touch buttons, at least the part of
> the
>> buttons I can see behind my 'modal' form, and they work.
>>
>> Any ideas?
>>
>>
>
>



Re: Z-order top using SetWindowsPos by Wapiti

Wapiti
Wed Nov 10 15:05:32 CST 2004

I guess I'm confused. The way I had it working before, without this
opennetcf code in form_load, the form would display and then disappear each
time. it wasn't until I added this code in the form load event procedure,
that it won't go away. It wasn't just tucking itself behind anything when
I closed it (me.close). It would actually close. And I was still
instantiating the form in a global variable and using it throughout my app.

Why, and this is an honest question, is it that adding the SetWindowPos code
to Form_Load would make this any different?

Whats the best method to open and close this custom messagebox form w/o
having to create a new form variable each time its called?

I think (suppose) I'm missing the boat big time here somewhere...???


"Peter Foot [MVP]" <feedback@no-spam.inthehand.com> wrote in message
news:OQ6vVX2xEHA.3840@tk2msftngp13.phx.gbl...
> If the form lives on through your app and you've overridden it to stay at
> the front it will, unless you step in and change the behaviour, when you
> want to hide the form call SetWindowPos again but this time either set
> HWND_BOTTOM or hide or resize the form so it's no longer visible.
> Then you'll have to set it top-most again when you want to show another
> message.
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> www.inthehand.com | www.opennetcf.org
>
> "Wapiti" <wapiti@noplaceforspam.com> wrote in message
> news:%23Fd0LS2xEHA.2348@TK2MSFTNGP12.phx.gbl...
> > Well, I think I have this figured out, but not sure what to do.
> >
> > I call this frmMsgBox form quite a few places, so rather than
instantiate
> > it
> > each time, I do it once in a global module.
> > Public fMsgBox As New frmMsgBox
> >
> > If I instantiate it each and every time I call it, rather than using
this
> > public form variable, it works.
> >
> > am I doing something stupid here (again?). How else would I make this
> > form
> > callable from multiple location, in a lot of places, without having to
> > instantiate it all the time?
> >
> > Thanks for any help.
> >
> >
> > "Wapiti" <wapiti@noplaceforspam.com> wrote in message
> > news:OAqLiM2xEHA.1392@tk2msftngp13.phx.gbl...
> >> "Peter Foot [MVP]" <feedback@no-spam.inthehand.com> wrote in message
> >> news:ul%23WSajxEHA.2676@TK2MSFTNGP12.phx.gbl...
> >> > You can use the technique described here to make your messagebox
dialog
> >> > always appear at the top of the z-order until it is dismissed:-
> >> >
http://blog.opennetcf.org/pfoot/#a11ad82c3-a428-4aac-959f-27c9c3590662
> >>
> >> Peter,
> >>
> >> You say, this works until the form is "dismissed". How do you dismiss
> >> the
> >> form? I've converted the code you provided me with that for VB.
> >>
> >> I'm using a Me.Close to close my form.
> >>
> >> The first time the form appears, it stays up as I was hoping it would,
> >> not
> >> getting hidden behind other forms. But the second and beyond time it
is
> >> called, its not going away, ever. I can tell that the form in the
> >> background is still running as I can touch buttons, at least the part
of
> > the
> >> buttons I can see behind my 'modal' form, and they work.
> >>
> >> Any ideas?
> >>
> >>
> >
> >
>
>