1
2//Get the Width and Height (resolution) of the screen
3System.Windows.Forms.Screen src = System.Windows.Forms.Screen.PrimaryScreen;
4
5int src_height = src.Bounds.Height;
6int src_width = src.Bounds.Width;
7
8//put the form in the center
9this.Left = (src_width - this.Width) / 2;
10this.Top = (src_height - this.Height) / 2;