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
 
 
 
 
 
TitleCenter the controls on a form
Keywordscenter controls
CategoriesControls
 
Place the controls in a PictureBox. At run time, cnter the PictureBox whenever the form is resized.

This example is maximized and the user cannot move or resize the form.

 
' At design time we set:
'     ControlBox = False
'     Caption = ""
'     WindowState = Maximized
'     BorderStyle = FixedSingle
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