Center MDI Child Form 
Author Message
 Center MDI Child Form

Hello, I know this question has been asked at one point or another,
but I was wondering if someone could give me the code to center
a MDI child form within the parent form.

Thanks in advance:

Wag



Thu, 28 Aug 1997 04:22:49 GMT  
 Center MDI Child Form


Quote:
>Hello, I know this question has been asked at one point or another,
>but I was wondering if someone could give me the code to center
>a MDI child form within the parent form.

Here is some code I am using in an app.  Note that you should probably
use the move method instead of setting the top and left properties. (I
will be changing that in the next version.)

                --              --              --

Sub CenterPT ()

    If frmPT.WindowState <> 0 Then
         Exit Sub
    End If

'   Center child form in parent.
    frmPT.Top = (frmPT_Mas.ScaleHeight - frmPT.Height) \ 2
    frmPT.Left = (frmPT_Mas.ScaleWidth - frmPT.Width) \ 2

End Sub

--
    "...last minute maneuvers in congress can make a mockery of
    presidential decrees."  ..Dan Rather, CBS Evening News, 3-3-95



Thu, 28 Aug 1997 11:45:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Centering 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