How to center MsgBox...

  • Thread starter Thread starter Nigel V Thomas
  • Start date Start date
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
 
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
 
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>
 
Back
Top