How to center MsgBox...

N

Nigel V Thomas

Is it possible to control the position of the MsgBox when it appears.

If possible I would like to to appear over any current form.

If not possible, has anyone any tips on writing your own MsgBox. I am
particularly stuck on the format of the message as in the height and width of
the message box

CHeers

Nigel
 
G

Gilbert Tordeur

Hi Nigel.

Just write a normal WinForm, display it with ShowDialog, and you will be
able to set any customized presentation you would like.

Gilbert
 
H

Herfried K. Wagner [MVP]

Nigel said:
Is it possible to control the position of the MsgBox when it appears.

If possible I would like to to appear over any current form.

That's not supported out of the box. You'd dig into the Win32 messages
using a Win32 dialog hook to position the message box yourself.
If not possible, has anyone any tips on writing your own MsgBox. I am
particularly stuck on the format of the message as in the height and width of
the message box

Implementing a message box with standard behavior
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=custommsgbox&lang=en>
 

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