Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MDI Child Form Positioning

Posted on 1997-03-26
1
Medium Priority
?
320 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 100 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Suggested Courses

664 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