Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996

Centering a Form on the Screen

Question:
How do I center a form on the monitor regardless of monitor resolution?

Answer:
The Screen object contains the properties of the current display. In the Form_Load event, you can use this code to center the form on the screen:

Me.Top = (Screen.Height - Me.Height) /2
Me.Left = (Screen.Width - Me.Width) /2
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date