Centering MDI Child Form 
Author Message
 Centering MDI Child Form

How can I center a MDI Child form when the MDI Parent is resized???

I know there has to be an easy way to do this!

Thanks,
Julie



Mon, 23 Aug 1999 03:00:00 GMT  
 Centering MDI Child Form



Quote:
>How can I center a MDI Child form when the MDI Parent is resized???

>I know there has to be an easy way to do this!

Well, I have a standard procedure to centre MDI child forms, which takes
the name of the form as its parameter. I would guess that you could
stick some code in the Resize event procedure of the parent form that
will cycle through the Forms collection and call this procedure for each
one. You may need to check whether each form is an MDI child form first
- a simple If statement can do this.

I should say that I have not tried all of this myself, so I can't
guarantee that it works, but good luck!

        John
--
John C. Kirk

"Prophecy is a poor guide to the future." (Delenn)



Mon, 23 Aug 1999 03:00:00 GMT  
 Centering MDI Child Form

Try this -

Create a sub routine in the MDIForm.

Sub CenterChild(M As MDIForm, F As Form)
    If M.WindowState > 0 Then
    Else
        F.Move (M.Width - F.Width) / 2, (M.Height - F.Height) / 2
    End If
End Sub

Put this code in the MDI forms Resize event.  This code will center any
form that is open.

    Dim I
    For I = 0 To Forms.Count - 1
            CenterChild MDIForm1, Forms(I)
    Next I

-- Teresa



Quote:
> How can I center a MDI Child form when the MDI Parent is resized???

> I know there has to be an easy way to do this!

> Thanks,
> Julie




Tue, 24 Aug 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Center MDI Child Form

2. Newbie Question - Center MDI child form

3. How to center MDI child form

4. Center an MDI Child in MDI form

5. Q: Form activate Fires On Non Child MDI Forms But Only Once On Child Mdi Forms

6. MDI Child Form Centering

7. center a child form in a MDI

8. Centering child form in MDI

9. Q: Centering an MDI Child Form

10. Centering a child form in an MDI Window

11. Centering child form in mdi window

12. How to center the MDI Child form when it is loaded

 

 
Powered by phpBB® Forum Software