Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows
Visual Basic > Forms sample source codes
Center a form on the screen
Center a form on the screen Declare this Subroutine in General Declarations: Public Sub SubFrmCntr(CurrentForm as Form) CurrentForm.Move (Screen.Width - CurrentForm.Width) \ 2, (Screen.Height - CurrentForm.Height) \ 2 Load CurrentForm CurrentForm.show End Sub 'Then, When you want to center a form: SubFrmCntr(ME) ' Since me is the object name of the current form Return
Privacy Policy
|
Link to Us
|
Links