Solved

MDI Child Form Positioning

Posted on 1997-03-26
1
318 Views
Last Modified: 2008-03-04
I am using VB Version 3.0

I have an application in which I have an MDI child form.
I want to be able to place the child form in the centre of the MDI window. Currently I am using the Top and Left properties of the child to do this but unfortunately the child window is realised before the positioning takes place because the VB help says that you cannot hide a MDI child form.

The overall effect is that the child form pops up in one part of the MDI window and them immediately centres itself.

Does anyone know of a way to make the child form appear in the MDI window without this "flickering" effect ?
0
Comment
Question by:Graeme Hartley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
ksleung earned 50 total points
ID: 1424749
I have written a routine called CentreMDIChild.  It works fine for me.  You may try and see whether it works for you or not.

Sub CentreMDIChild(frmChild As Form)
 frmChild.Top = (MainContainer.ScaleHeight - frmChild.Height) / 2
 frmChild.Left = MainContainer.Left + _
  (MainContainer.ScaleWidth - frmChild.Width) / 2
End Sub

BTW, my PC config. is P166 with 32MB RAM and running on NT 3.51 with SP5. If your PC's display card is slow, then it may affect the GUI.


0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

631 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