Results 1 to 5 of 5

Thread: Maximize MDI Child [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    547

    Resolved Maximize MDI Child [RESOLVED]

    Ok-

    So I've got my MDI form which loads at startup. My problem now is this.

    I would like one my MDI Childed (MDIChild = True) forms to open up Maximized in the MDI Parent, however, even when set to maximized it does not work. Also, I would like to change this form to non-resizable, but I cannot select this option - it gives me an error.

    A second form, I would like to be non-resizable and CENTERED (not maximized) in the MDI parent. Again, I can set the form to CenteredOwner, but it doesn't work.

    Can these be done?
    Last edited by mateo107; Apr 12th, 2005 at 05:48 PM. Reason: RESOLVED


    -Matthew-

  2. #2

    Thread Starter
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    547

    Re: Maximize MDI Child

    Actually - I've managed to get the form to open sort of the way I need it to, but heres my current delema.

    In order to have my form show up automatically, I have added the statement

    frmName.Show into my On_Load Sub routine for the MDI Parent form. The only problem is that the MDI form takes control and is the active window, when really I need the frmName form to be the active window and the MDI parent form to remain open in the background.

    Any ideas?


    -Matthew-

  3. #3
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: Maximize MDI Child

    Quote Originally Posted by mateo107
    Actually - I've managed to get the form to open sort of the way I need it to, but heres my current delema.

    In order to have my form show up automatically, I have added the statement

    frmName.Show into my On_Load Sub routine for the MDI Parent form. The only problem is that the MDI form takes control and is the active window, when really I need the frmName form to be the active window and the MDI parent form to remain open in the background.

    Any ideas?
    You can't do that really, the MDI parent is meant to be the form that is in the foreground and all child forms are contained within this form, so you cant really make the parent form be open in the background; its not meant to be.

  4. #4

    Thread Starter
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    547

    Re: Maximize MDI Child

    okay - i think i can get around it by making my splash screen (not MDI) the program startup screen... and then I can have that call my MDI form (do it backwards from what i have now)

    thanks!


    -Matthew-

  5. #5
    Lively Member haruki's Avatar
    Join Date
    Mar 2005
    Location
    Shibuya / Japan
    Posts
    118

    Re: Maximize MDI Child [RESOLVED]

    There should be no problems when setting a MDIChild to maximum size (if you have choosen Fixed single then it will not work)

    If you want it to be non-resizable (as Fixed single) and mazimized then use None(-border) and maximize it as below.

    Try:
    VB Code:
    1. Form1.Height = MDIForm1.ScaleHeight
    2. Form1.Width = MDIForm1.ScaleWidth

    To center a MDIChild try:

    VB Code:
    1. Form1.Left = MDIForm1.ScaleWidth / 2 - Form1.ScaleWidth / 2
    2. Form1.Top = MDIForm1.ScaleHeight / 2 - Form1.ScaleHeight / 2

    If you try to center a MDIChild you will get a Invalid Property Value.

    From MSDN:
    The initial size and placement of MDI child forms are controlled by the Microsoft Windows operating environment unless you specifically set them in the Load event procedure.

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