Centering a from horixontally ONLY

Hi, is there a way of centring a form on the screen horixontally only. So setting Position to poScreenCenter won't work as I want to keep my vertical setting.

Thanks, Tom.
boardtcAsked:
Who is Participating?
 
viktornetConnect With a Mentor Commented:
YourForm.Left := (Screen.Width div 2)-(YourForm.Widht div 2);

Regards,
Viktor Ivanov
0
 
viktornetCommented:
In case you need for vertical centering...it's the same.....

YourForm.Top := (Screen.Height div 2)-(YourForm.Height div 2);

Regards,
Viktor Ivanov
0
 
boardtcAuthor Commented:
Duh :-) Thanks a lot :-) Tom.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.