Results 1 to 4 of 4

Thread: MDI child form positioning.

  1. #1

    Thread Starter
    Hyperactive Member nickwrs's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta, Ga
    Posts
    398

    Post

    Every time I Start a program with a MDI child in the MDI parent form, It starts it in the Top left portion of the parent form.

    I need the form to start centered...

    is this possible???

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    You can always put this in the Load event of the child form;

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

    In VB6 you can set the StartupPosition Property of the child form to CentreOwner.



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



  3. #3
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    I ha the same problem, so I used this

    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - frmMDI.Toolbar1.Height

    Only include the toolbar bit if your main form has a toolbar. Put it in the form_load.

    Good luck!

    ------------------
    - Chris
    [email protected]
    Q. Why do mice have small balls?
    A. Not that many know how to dance

  4. #4

    Thread Starter
    Hyperactive Member nickwrs's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta, Ga
    Posts
    398

    Post

    Actually I can't make the start up posistion = to center owner... it gives me an error of invalid property value.

    I have VB 6

    ?
    The other option works, but the main form I just have maximized. and that only takes into account the property values of the acutal form. I want this to be able to be runa nd look good on various screen sizes and resolutions.

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