Results 1 to 2 of 2

Thread: [RESOLVED] Center a mdichild form in a mdiparent

  1. #1

    Thread Starter
    Hyperactive Member Chathura's Avatar
    Join Date
    Nov 2005
    Location
    Sri Lanka
    Posts
    345

    Resolved [RESOLVED] Center a mdichild form in a mdiparent

    I am using an mdiparent form. What I want to do is place the mdichild form in the center of the mdiparent form when the mdichild loads. Do you have any suggessions?

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Center a mdichild form in a mdiparent

    In the child's Form_Activate event:
    VB Code:
    1. Private Sub Form_Activate()
    2.     Form1.Move ((MDIForm1.ScaleWidth - Me.ScaleWidth) / 2), ((MDIForm1.ScaleHeight - Me.ScaleHeight) / 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