Results 1 to 2 of 2

Thread: how to make a child form open up in same x and y axis inside MDI form

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    2

    how to make a child form open up in same x and y axis inside MDI form

    I have a child form inside my MDI. every time i close this child form and open it again it opens up on different parts of mdi form. I want it always to open up on the TOP LEFTMOST corner of the MDI form. Could someone please tell me how to do that. Also how to make the second child form always open up in the middle of the screen. thanks.

  2. #2
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506
    Assumes default names...

    For your first child form:
    VB Code:
    1. Private Sub Form_Load()
    2.   Me.Move 0, 0
    3. End Sub

    For your second child form:
    VB Code:
    1. Private Sub Form_Load()
    2.   Me.Move (MDIForm1.ScaleWidth - Me.Width) / 2, (MDIForm1.ScaleHeight - Me.Height) / 2
    3. 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