Reputation: 730
I've been looking around for this answer but can't seem to find it. I'm running VS2012 with VB.Net and have a multi-form application. As the forms open, they always appear in different spots, almost cascading down the screen if I were to have them all open at once. How can I make them always appear centered?
For example:
Form1.ShowDialog()
This should be in the center of the screen, and appear there every time it is opened.
Upvotes: 1
Views: 2393
Reputation: 81655
Try:
Form1.StartupPosition = FormStartPosition.CenterScreen
Form1.ShowDialog()
Upvotes: 6