?
Solved

Positioning of Child Forms on MDI Form

Posted on 2005-03-26
4
Medium Priority
?
188 Views
Last Modified: 2010-05-02
I have a standard MDI Form with 5 or 6 different Child Forms.  The problem is that the program does not recognize when child forms are closed.  For example, I open two forms...and then close them.  When I open the third form, it opens where a third form would be...rather than where the first opened form would be.  Does anyone have a routine or an easy way to fix this?  Thanks.
0
Comment
Question by:tsicks
[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
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
Shauli earned 400 total points
ID: 13637298
You can cascade the forms, so if more than one form is shown, they will be cascaded, and if only one is shown, it will be displayed in the upper left position. To do that, simply add the cascade command after your form.show, as in:

Form1.Show
MDIForm1.Arrange vbCascade

S
0
 

Author Comment

by:tsicks
ID: 13637335
That does work, but I see a visible jump.  Is there anyway to minimize the jump?
0
 
LVL 19

Expert Comment

by:Shauli
ID: 13637383
There is nothing much you can do about it, unless you want to lock the form:

LockWindowUpdate Me.hWnd  'lock
Form1.Show
MDIForm1.Arrange vbCascade
LockWindowUpdate False   'unlock


For that to work you need to put the following code in a bas module:

Option Explicit
Public Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long

S
0
 

Author Comment

by:tsicks
ID: 13637452
That takes care of the problem.  Thanks for the help.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 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