Center_Form

By | 2002-06-01

To center all of your forms nicely on the screen, use this as the first line in the Form_Load event–resolution independent.
‘note:call this function like this:
Center_Form Me

Original Author: Ian Ippolito (psc)

Inputs

frmForm–form to center. Call this function like this:Center_Form Me

Code

Sub Center_Form (frmForm As Form)
frmForm.Left = (Screen.Width - frmForm.Width) / 2
frmForm.Top = (Screen.Height - frmForm.Height) / 2
End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.