Results 1 to 7 of 7

Thread: [RESOLVED] MDI Form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    16

    Resolved [RESOLVED] MDI Form

    Hi

    Child forms in a project do not display the size set at design time.

    Any reason why this should happen?

    regards
    dandy

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: MDI Form

    Typical behaviour of a MDI child. If you want the form to be a specific size then you should add some code to the load event to size it the way you want.

  3. #3
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Re: MDI Form

    write at code window of child form something like
    Code:
    Public Sub Form_Load()
    frmchild.width = 8160 'according to your need
    frmchild.Height = 5970 'according to your need
    frmchild.Show
    End Sub

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: MDI Form

    you don't need a show method there. More likely the call to show has already been made and is what triggered the Load event.

  5. #5
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Re: MDI Form

    Then i will suggest .write the code in Resize event .No need to show the form.
    Code:
    Private Sub Form_Resize()
    Me.Height = 4525 'as per your need
    ME.WIDTH=3214 'as per your need
    End Sub

  6. #6
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: MDI Form

    Do not place the code in the resize event unless you want to prevent the user from being able to resize the form.

    Best to do it as I suggested and just set the size in the form load event. No need to add the line to show the form just code in the load to set the initial form size that you want. Typically I also include a call to a sub routine which will center the child within the parent window but this of course is optional.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    16

    Re: MDI Form

    Dear DataMiser, Firoz.raj,

    Thanks a ton for throwing some light.

    I was going nuts as the problems are intermittant.

    Made necessary changes to code and it works fine.

    Have a great day.!!!!

    Dandy

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