Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Positioning of Child Forms on MDI Form

Posted on 2005-03-26
4
Medium Priority
?
193 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

580 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