We have a weird problem, where we are popping up a msgbox, and
intermittently it is displaying BEHIND the main app form.

Basically, our form is up, we call a simple msgbox, and 97 times out of 100
it pops up exactly right. 3 times out of 100 it pops up behind the app. It
panics the user, as they can no longer click on the app. They must minimize
the app, click on the dialog, then restore the app.

We have tried "MsgBoxStyle.MsgBoxSetForeground" and
"MsgBoxStyle.ApplicationModal" to no avail...

VS2002, WinXP

Any ideas for workarounds or troubleshooting this one?

Thanks!

Re: Msgbox Appearing BEHIND application Form by Chris

Chris
Wed Sep 10 00:19:27 CDT 2003

Hi,

Have you tried specifiying the Application Form as the owner of the
MessageBox, some of the overloads of MessageBox.Show accept a IWin32Window
owner parameter, you can pass the form in here.

Hope this helps

Chris Taylor
"Tappy Tibbons" <tappytibbons@sbcglobal.net> wrote in message
news:%23bsmqbzdDHA.568@TK2MSFTNGP11.phx.gbl...
> We have a weird problem, where we are popping up a msgbox, and
> intermittently it is displaying BEHIND the main app form.
>
> Basically, our form is up, we call a simple msgbox, and 97 times out of
100
> it pops up exactly right. 3 times out of 100 it pops up behind the app. It
> panics the user, as they can no longer click on the app. They must
minimize
> the app, click on the dialog, then restore the app.
>
> We have tried "MsgBoxStyle.MsgBoxSetForeground" and
> "MsgBoxStyle.ApplicationModal" to no avail...
>
> VS2002, WinXP
>
> Any ideas for workarounds or troubleshooting this one?
>
> Thanks!
>
>
>
>



Re: Msgbox Appearing BEHIND application Form by Tappy

Tappy
Wed Sep 10 08:34:57 CDT 2003

I thought I remembered there was a place to set an owner! But, i was using
the old MsgBox() vs. the MessageBox.Show().

I will try it, Thanks.

BTW - Any ideas on what internal differences there are, if any, between
msgbox() and MessageBox.Show()?


"Chris Taylor" <chris_taylor_za@hotmail.com> wrote in message
news:OZjlnq1dDHA.1448@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> Have you tried specifiying the Application Form as the owner of the
> MessageBox, some of the overloads of MessageBox.Show accept a IWin32Window
> owner parameter, you can pass the form in here.
>
> Hope this helps
>
> Chris Taylor
> "Tappy Tibbons" <tappytibbons@sbcglobal.net> wrote in message
> news:%23bsmqbzdDHA.568@TK2MSFTNGP11.phx.gbl...
> > We have a weird problem, where we are popping up a msgbox, and
> > intermittently it is displaying BEHIND the main app form.
> >
> > Basically, our form is up, we call a simple msgbox, and 97 times out of
> 100
> > it pops up exactly right. 3 times out of 100 it pops up behind the app.
It
> > panics the user, as they can no longer click on the app. They must
> minimize
> > the app, click on the dialog, then restore the app.
> >
> > We have tried "MsgBoxStyle.MsgBoxSetForeground" and
> > "MsgBoxStyle.ApplicationModal" to no avail...
> >
> > VS2002, WinXP
> >
> > Any ideas for workarounds or troubleshooting this one?
> >
> > Thanks!
> >
> >
> >
> >
>
>



Re: Msgbox Appearing BEHIND application Form by Chris

Chris
Wed Sep 10 18:08:54 CDT 2003

Hi,

Basically the MsgBox translates the VB6 like parameters into the relevant
MessageBox.Show parameters and calls MessageBox.Show. I confirmed this with
ILDASM.

Hope this helps

Chris Taylor
"Tappy Tibbons" <tappytibbons@sbcglobal.net> wrote in message
news:usdDWB6dDHA.3788@tk2msftngp13.phx.gbl...
> I thought I remembered there was a place to set an owner! But, i was using
> the old MsgBox() vs. the MessageBox.Show().
>
> I will try it, Thanks.
>
> BTW - Any ideas on what internal differences there are, if any, between
> msgbox() and MessageBox.Show()?
>
>
> "Chris Taylor" <chris_taylor_za@hotmail.com> wrote in message
> news:OZjlnq1dDHA.1448@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > Have you tried specifiying the Application Form as the owner of the
> > MessageBox, some of the overloads of MessageBox.Show accept a
IWin32Window
> > owner parameter, you can pass the form in here.
> >
> > Hope this helps
> >
> > Chris Taylor
> > "Tappy Tibbons" <tappytibbons@sbcglobal.net> wrote in message
> > news:%23bsmqbzdDHA.568@TK2MSFTNGP11.phx.gbl...
> > > We have a weird problem, where we are popping up a msgbox, and
> > > intermittently it is displaying BEHIND the main app form.
> > >
> > > Basically, our form is up, we call a simple msgbox, and 97 times out
of
> > 100
> > > it pops up exactly right. 3 times out of 100 it pops up behind the
app.
> It
> > > panics the user, as they can no longer click on the app. They must
> > minimize
> > > the app, click on the dialog, then restore the app.
> > >
> > > We have tried "MsgBoxStyle.MsgBoxSetForeground" and
> > > "MsgBoxStyle.ApplicationModal" to no avail...
> > >
> > > VS2002, WinXP
> > >
> > > Any ideas for workarounds or troubleshooting this one?
> > >
> > > Thanks!
> > >
> > >
> > >
> > >
> >
> >
>
>