Click here to Skip to main content
15,747,059 members
Please Sign up or sign in to vote.
3.00/5 (3 votes)
See more:
Hi all...

i want to launch the application at the center of the screen at very first time only.. after that on the closing event i'll store the location and size in the settings.setting.cs file.. after onwards i'll read from there..

now it is starting at the top left corner of the window..

can anybody help me...

Thanks in advance...

Set Form.StartPosition property to CenterScreen.
Share this answer
Harish Reddy K 14-Jul-11 8:26am    
I tried this one but it is not working. thanks for ur reply...
Sergey Alexandrovich Kryukov 14-Jul-11 17:11pm    
If does work, but you could easily screw up by something modifying form size down the road.
Sergey Alexandrovich Kryukov 14-Jul-11 17:11pm    
My 5, but OP may need more help by the reason I explained above.
Philippe Mori 14-Jul-11 20:10pm    
If you want to do it only the first time, then check your settings to see if the position was previously saved and if so restore it.
Found this in Google
A Form Center Screen[^]
Share this answer
Sergey Alexandrovich Kryukov 14-Jul-11 17:12pm    
Why? Solution by Shameel does work, try it.
Harish Reddy K 14-Jul-11 23:55pm    
thanks all for replying me...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900