Results 1 to 6 of 6

Thread: [RESOLVED] MDIchild form moving after every .Show

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Location
    California
    Posts
    29

    Resolved [RESOLVED] MDIchild form moving after every .Show

    Hi,
    I use this code:

    Unload frmChild
    DoEvents
    frmChild.Show

    When the child form is shown, its border size remains the same but its location in the parent MDI Form changes. How can i get rid of this?
    Thanks

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: MDIchild form moving after every .Show

    It's StartUpPosition property is probobally set to 3 - Windows Default. Try to change it to 1 - CenterOwner.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Location
    California
    Posts
    29

    Re: MDIchild form moving after every .Show

    its set to 0-manual, and i am not able to change it. I get an "invalid property value" when i try to change it.

  4. #4
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: MDIchild form moving after every .Show

    Ohh... forgot we were talking about MDI's Try this (in MDIChild's Form_Resize sub):

    VB Code:
    1. Private Sub Form_Resize()
    2.     Me.Move ((MDIForm1.ScaleWidth / 2) - (Me.ScaleWidth / 2)), ((MDIForm1.ScaleHeight / 2) - (Me.ScaleHeight / 2))
    3. End Sub
    Btw... also, try to hide it (Me.Hide) instead of unloading it

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Location
    California
    Posts
    29

    Re: MDIchild form moving after every .Show

    Thanks Gavio! This worked

  6. #6
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: MDIchild form moving after every .Show

    Quote Originally Posted by madmaxmenon
    Thanks Gavio! This worked
    I'm glad it did

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