• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Centering a form

How do you load a form into a MDI form and not have it open in the upper lefthand corner of the MDI form. Would like it to open in the center. In the form layout window I both forms in the center. The MDI Properties "Window State" is set to 2-Maximized.
0
tbred
Asked:
tbred
  • 2
1 Solution
 
jmnolanCommented:
You have to position it manually. This can be done in the Load event or where ever else youd like to put it.

Esentially this code in the child forms Load event:

Me.Top = (MDIForm1.ScaleHeight - Me.Height) / 2
Me.Left = (MDIForm1.ScaleWidth - Me.Width) / 2
0
 
tbredAuthor Commented:
Thanks Tbred
0
 
tbredAuthor Commented:
Thanks jmnolan
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now