C#: Center MessageBox

MessageBox in C# is supposed to be modal. At least that was what I expected. However, upon using it, it does not center itself against the parent container. Rather, it positions itself at the center of the screen. So if your parent container would be moved to the lower right, the MessageBox will still appear at the center no matter what. Luckily, somebody from CodeProject saved us the trouble of having to create a custom class to make this work. His custom class wraps the MessageBox class into a new class name called MsgBox but with the same constructors and usage.

Pretty nifty. Since this saved me time and trouble of having to create one for myself . You can check the article here.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *