Solved

unable to center form on screen

Posted on 1999-01-15
2
182 Views
Last Modified: 2010-05-03
I have a few forms (not full size) and I need it to be centered on the screen everytime it loads. The problem is the form always runs or appear randomly on the screen. How do I fix it so that it will appear in the center of the screen?

The smaller forms will call each other and I need to have my main form (maximize) behind it "disabled" until the smaller forms are clicked. I tried setting the smaller forms to Form1.show 1 but it only shows the smaller form without the main form behind it. How to solve this too?
0
Comment
Question by:ute
2 Comments
 
LVL 1

Accepted Solution

by:
agrillage earned 100 total points
ID: 1456584
If you are using VB5 or VB6 then your form has a startup position property. Set this to center of owner or center of screen. As for the other problem, try using an MDI form as your main form if you want the background window to manage the forms. Make the form's mdi child properties true for the front forms.
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1456585
Try this:

Private Sub Form_Load()
    Width = Screen.Width * 0.7
    Height = Screen.Height * 0.7
    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
End Sub

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

810 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