Results 1 to 20 of 20

Thread: [RESOLVED] MDI Child not working properly

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Resolved [RESOLVED] MDI Child not working properly

    My MDIChild = yes form looks cut off at the bottom. I don't want to but I can resize to show the complete form. When I Maximize, Minimize or Close it works fine within the Parent.

    If I change the form to MDIChild = no it is NOT cut off at the bottom but it also doesn't function within the Parent.

    I've been reading other resolutions but I'm only becoming more confused.

    This has to be a simple Property problem (I hope).

    Can you help me..... Thanks

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: MDI Child not working properly

    There are scrollbars at the sides for the MDIparent. If you don't want your child forms to get "cut off" then you'll have to move them around the interior of the mdiparent (top left properties).

    You'll have to consider MDiparent resize though. How will you position the child if the parent is resized less than the child form.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: MDI Child not working properly

    The child form is cut off at bottom but it is not larger then parent form.
    Scrollbars have not come into play here.

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: MDI Child not working properly

    Try to set the form size (child) on form_load event of child.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: MDI Child not working properly

    NO.
    Doesn't the the form size get set by it's size properties from design time?
    I this something that has to be in a Resize_Form() after initial load?

  6. #6
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: MDI Child not working properly

    yes u can set the size in properties.. but also at runtime

    in the Form_Load event

    Me.top = 0
    Me.left = 0
    Me.width = xxx
    Mie.Height = xxx
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: MDI Child not working properly

    I'll give it a shot and be back with results.

  8. #8
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: MDI Child not working properly

    you could just position it in form_load():
    VB Code:
    1. Private Sub Form_Load()
    2.     Me.Move 0,0
    3. End Sub

    Edit: too slow

  9. #9
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: MDI Child not working properly

    Quote Originally Posted by Mikey
    NO.
    Doesn't the the form size get set by it's size properties from design time?
    I this something that has to be in a Resize_Form() after initial load?
    Since the mdi parent imposes default child size (percentile based on its own current size, around 75%) disregarding design time dimensions, you will have to get the child to insist on its own size at run time.

    Static posted sample code above.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: MDI Child not working properly

    OK that helped a lot. I put....

    Private Sub Form_Load()
    On Error Resume Next
    Me.Show
    Form_Resize
    Dim conn As ADODB.Connection
    ect..

    Private Sub Form_Resize()
    On Error Resume Next
    Me.Top = 0
    Me.Left = 0
    Me.Width = 12720
    Me.Height = 7380
    End Sub


    Thanks

  11. #11
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: MDI Child not working properly

    No prob Please take the time to mark the thread as resolved.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: MDI Child not working properly

    Me.Move 0,0 alone doesn't do anything.

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: MDI Child not working properly

    thanks to both.

  14. #14
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: MDI Child not working properly

    Quote Originally Posted by Mikey
    Me.Move 0,0 alone doesn't do anything.
    We both thought initially that the child form exceeded the parent's interior hence was "cut off". Only after your succeeding posts did we realize that you meant it being cut due to resize.

  15. #15
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: [RESOLVED] MDI Child not working properly

    VB Code:
    1. Private Sub Form_Load()
    2.     On Error Resume Next
    3.     Me.Show
    4.     resize_me
    5.     Dim conn As ADODB.Connection
    6.     ect..
    7. End Sub
    8.  
    9. Private Sub resize_me()
    10.     Me.Top = 0
    11.     Me.Left = 0
    12.     Me.Width = 12720
    13.     'OR Me.Width = PARENTFORMNAME.ScaleWidth
    14.     Me.Height = 7380
    15.     'OR Me.Height = PARENTFORMNAME.ScaleHeight
    16. End Sub
    17. Private Sub Form_Resize()
    18.     'Use this to resize controls.. not the form
    19.     'UNLESS u want the form to be locked in that position and that size
    20.     'because if u resize it.. it will snap back to those dimensions
    21. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: [RESOLVED] MDI Child not working properly

    No problem, I can see that. I'll try to be more clear in the future.

    Thanks again.

  17. #17
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: MDI Child not working properly

    Quote Originally Posted by Mikey
    OK that helped a lot. I put....

    Private Sub Form_Load()
    On Error Resume Next
    Me.Show
    Form_Resize
    Dim conn As ADODB.Connection
    ect..

    Private Sub Form_Resize()
    On Error Resume Next
    Me.Top = 0
    Me.Left = 0
    Me.Width = 12720
    Me.Height = 7380
    End Sub


    Thanks
    Form_Resize event will automatically fire when the form is shown, you're firing it twice.

    you should have no problems with
    VB Code:
    1. Private Sub Form_Load()
    2.     Me.Move 0, 0, 12720, 7380
    3.     Me.Show
    4. '
    5. '
    6. '
    7. End Sub
    as leinad said, i didn't realise you wanted to set the height/width.

    using .Move is quicker than setting them all individually

  18. #18

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: [RESOLVED] MDI Child not working properly

    Oh how interesting. Nothing is easy is it?

    I'll try this code and be back....

    Thanks

  19. #19

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: [RESOLVED] MDI Child not working properly

    Well Me.Move 0, 0, 12720, 7380
    Me.Show
    works nicely.

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Re: [RESOLVED] MDI Child not working properly

    Private Sub resize_me() Me.Top = 0 Me.Left = 0 Me.Width = 12720 'OR Me.Width = PARENTFORMNAME.ScaleWidth Me.Height = 7380 'OR Me.Height = PARENTFORMNAME.ScaleHeight End Sub

    This cuts it off again.

    Me.Move 0, 0, 12720, 7380
    Me.Show
    works nicely.

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