Positioning of Child Forms on MDI Form

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.
tsicksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ShauliCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tsicksAuthor Commented:
That does work, but I see a visible jump.  Is there anyway to minimize the jump?
0
ShauliCommented:
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
tsicksAuthor Commented:
That takes care of the problem.  Thanks for the help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.