How do I center a WinForm on screen?

jdana
jdana used Ask the Experts™
on
How do open a WinForm with it centered in the middle of the display?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015
Commented:
Set the StartupPosition to CenterScreen.
kaufmedGlanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015

Commented:
Sorry, it's StartPosition, not StartupPosition  : )
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Mohamed AbowardaSenior Software Engineer
Commented:
You might want to center the form using the code as well, take a look here:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=82

Author

Commented:
kaufmed,

Thanks!

disrupt & Medo3337,

Thanks for the extra tips.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial