Center a form – Short, Simple, and Sweet

By | 2002-06-01

This code allows you to quickly center a form within the screen without eating up alot of cpu time.

Original Author: Scott Fitzhugh

Side Effects

none. The form gets centered.

API Declarations

Code

sub form_load()
me.left = (screen.width / 2) - (me.width / 2)
me.top = (screen.height / 2) - (me.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.