Is there any way to get the height of the part of an MDI mother form where the MDI children appear ? I'am trying to center an mdi child form in the mdi mother. Thanks
Printable View
Is there any way to get the height of the part of an MDI mother form where the MDI children appear ? I'am trying to center an mdi child form in the mdi mother. Thanks
ScaleHeight and ScaleWidth are what you need.
this works pretty well for me...
VB Code:
Public Sub CenterChild(Parent As Form, Child As Form) On Error GoTo EH: Dim iTop As Integer Dim iLeft As Integer iTop = (Parent.ScaleHeight - Child.Height) / 3 iLeft = ((Parent.ScaleHeight - Child.Width) \ 2) Child.Move iLeft, iTop Exit Sub EH: End Sub