jamesdlivesinatree
jamesdlivesinatree

Reputation: 730

Have forms pop up in same spot each time

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

Answers (2)

user14535959
user14535959

Reputation: 1

Form.StartPosition = FormStartPosition.CenterScreen;

Upvotes: -2

LarsTech
LarsTech

Reputation: 81655

Try:

Form1.StartupPosition = FormStartPosition.CenterScreen
Form1.ShowDialog()

Upvotes: 6

Related Questions