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