Results 1 to 3 of 3

Thread: MDI Question

  1. #1

    Thread Starter
    Hyperactive Member maxl's Avatar
    Join Date
    Jan 2002
    Location
    Montréal
    Posts
    384

    MDI Question

    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
    COBOL sa suce !!!

  2. #2
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    ScaleHeight and ScaleWidth are what you need.

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    this works pretty well for me...

    VB Code:
    1. Public Sub CenterChild(Parent As Form, Child As Form)
    2.     On Error GoTo EH:
    3.         Dim iTop As Integer
    4.         Dim iLeft As Integer
    5.         iTop = (Parent.ScaleHeight - Child.Height) / 3
    6.         iLeft = ((Parent.ScaleHeight - Child.Width) \ 2)
    7.         Child.Move iLeft, iTop
    8.         Exit Sub
    9. EH:
    10. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width