Solved

Centering a form

Posted on 1999-01-04
3
272 Views
Last Modified: 2011-09-20
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
Comment
Question by:tbred
  • 2
3 Comments
 

Accepted Solution

by:
jmnolan earned 200 total points
Comment Utility
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
 

Author Comment

by:tbred
Comment Utility
Thanks Tbred
0
 

Author Comment

by:tbred
Comment Utility
Thanks jmnolan
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now