?
Solved

C# WinForms - Center a window

Posted on 2007-08-02
4
Medium Priority
?
4,219 Views
Last Modified: 2012-05-05
Hi,

How do you center a window?

Always when I create a new Form, it gets created in a different position?

Any ideas?

Thank you.
0
Comment
Question by:Endelm
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 2000 total points
ID: 19617312
this.StartPosition=FormStartPosition.CenterScreen;
0
 
LVL 35

Expert Comment

by:YZlat
ID: 19617336
you put this code in the form's Load event
0
 
LVL 4

Expert Comment

by:aponcealbuerne
ID: 19617337
Hi, you can set the StartPosition property to
CenterScreen
or Maybe to CenterParent
0
 

Expert Comment

by:jaynesh
ID: 23890364
set the stat position in form property as center to screen
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question