Added: Apr 29, 2002
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo
How to center a form
Highlight all by clicking in box
'Put this code in the BAS module
Sub Center_Form (frmForm As Form)
frmForm.Left = (Screen.Width - frmForm.Width) / 2
frmForm.Top = (Screen.Height - frmForm.Height) / 2
Center on the screen
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
'Centers over main form
Me.Left = frmMain.Left + (frmMain.Width - Me.Width) / 2
Me.Top = frmMain.Top + (frmMain.Height - Me.Height) / 2
'Or create a Center_Form Sub routine
'Call the routine like this:
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.