locating MessageBox within calling form?

G

Guest

I am using 2003 .NET and have a simple form that when encounters an error it
will
bring up the MessageBox to display the error. I want that message box to
pop up over the calling form, but it always pops up in middle of my screen.
My understanding of the documenation implies that this can be done by passing
a IWin32Windows parameter.
I can not figure out how to get this data from my form. The microsoft
examples show just passing "this" for the parameter, but I tried that and it
still just poped up in middle of my screen. So if some one could tell me how
to get the screen to pop up over the calling form I would greatly appreciate
it

Thanks,
Brian
 
S

Stoitcho Goutsev \(100\)

brian_harris,

I don't think you can control that. IWin32Windows is interface implemented
by all Control so you can pass any reference to a control. However this
doesn't mean this will center the message box relative to this control. If
you read carefully the docs they say that the message box will be
dispsplayed "in front of" passed control. This concerns only the Z order of
the elements not the XY possition of the message box.

If you want to have control over the possition you need to implement your
own message box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top