Results 1 to 3 of 3

Thread: MDI form child position

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    8
    Hi,

    Does anyone know how to make startup position of MDI form child in the center of MDI form parent ?

    Thanks

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    1. You could set the form's StartupPosition property to 1=CenterOwner

    2. You could use this code in the form's load event;

    Me.Left=(MDIForm.Width-Me.Width)/2
    Me.Top=(MDIForm.Height-Me.Height)/2

    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Thumbs up

    That will work as long as the mdi form has no toolbar or statusbar otherwise it won't appear in the centre of the form.

    Try this :

    Me.Top = (MDIForm.ScaleHeight - Me.Height) / 2
    Me.Left = (MDIForm.ScaleWidth - Me.Width) / 2

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