tsicks
asked on
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
That takes care of the problem. Thanks for the help.
ASKER