Universal Centering Procedure

Category:
Forms and Controls
Type:
Snippets
Difficulty:
Beginning
Author:
Ethan

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
This procedure will:
  • Center forms on screen, MDI forms
  • Any controls on any forms, frames or pictureboxes
Sample Call: CenterMe form1, screen

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: