VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



CenterForm

by Ian Ippolito (vWorker) (14 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (39 Votes)

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

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

Rate CenterForm

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

Download this snippet    Add to My Saved Code

CenterForm Comments

No comments have been posted about CenterForm. Why not be the first to post a comment about CenterForm.

Post your comment

Subject:
Message:
0/1000 characters