Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleFill the screen with a form and center the controls it contains
Keywordsfull screen form, center controls
CategoriesControls
 
At design time set:

  • ControlBox = False
  • Caption = ""
  • WindowState = Maximized
  • BorderStyle = None

Put the controls inside a PictureBox. When the form first resizes, center the PictureBox.

 
Private Sub Form_Resize()
    picCenter.BorderStyle = vbBSNone
    picCenter.Move _
        (ScaleWidth - picCenter.Width) / 2, _
        (ScaleHeight - picCenter.Height) / 2
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated