[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
vbcenterform
In “general declaration” or a module
And in the Load Event of your form.
VB FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
vbcenterform
How do I center a form in Visual Basic?
Quite simple. No need to mess about with the layout designer either. At the end of the day you can’t assume that everyone else will use the same screen resolution as yourself.In “general declaration” or a module
Function FrmCenter(ByVal FrmName As String) As Integer FrmName.Move (Screen.Width / 2 – FrmName.Width / 2), (FrmName.Height / 2 – FrmName.Height / 2) End Function
And in the Load Event of your form.
Form(x)_Load() Call FrmCenter(Form(x)) End Sub
VB FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
