Results 1 to 3 of 3

Thread: aligning an mdichild?

  1. #1

    Thread Starter
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197

    aligning an mdichild?

    I have an mdiform with childs. I know that the align property can (and has to be) set when placing controls directly on the mdiform. I made at startup two pictureboxes combine into one L-shaped picturebox in order to accomadate a control so it looks good. That all worked fine, but because of the L-shape, it pushes the mdichild off the screen! I could fix this if I made the mdichild align to the right, but how do I do that? There isn't a frmChild.align property.
    retired member. Thanks for everything

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Location
    Lincolnshire, UK
    Posts
    111
    Not sure if this will work (i'm not near a design environment), but I think that an MDI child form has a .left property. If so then use this code to align it to the right of a MDI form

    Private Sub AlignChildFormRight(vChildForm as form)
    vChildForm.left=MDIForm.Width-vChildForm.width-100
    End Sub

    This should align to the right, although you may have to change the 100 at the end to get rid of scroll bars if you don't want them

    Cheers

    Chris

  3. #3
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi
    There are a few ways to handle this problem.

    1) You could set the child form's WindowState property to Maximized; OR

    2) You could resize the child form as required.
    VB Code:
    1. 'Code within the MDI form (eg command button etc)
    2.     frmChild.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
    3.     frmChild.Show

    Regards
    Stuart
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

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