Results 1 to 2 of 2

Thread: How to set childform to overlap every new childform.

  1. #1

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    How to set childform to overlap every new childform.

    Hi every vbforum members,

    Can someone teach me how to set up a childform layout to overlap each page. The mdilayout contains 4 type of members. Cascade , tilehorizontal, tilevertical and arrangeicons. I met a problem against it. When i open a childform it will close the running childform. the code as below.

    Code:
    Public Sub ChildFormLoading(ByVal ChildForm As Form, ByVal FormName As String)
            For Each f As Form In Me.MdiChildren
    
                If Not f.Name = FormName Then
                    f.close()
    
                End If
            Next
            For Each f As Form In Me.MdiChildren
    
                If f.Name = FormName Then
                    Exit Sub
    
                End If
            Next
            ChildForm.MdiParent = Me
            ChildForm.Show()
        End Sub
    After I open a childform it will always move like cascade. I want it remain at same position.

    Can someone professional here give me a help, sorry because i really new at VS...

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to set childform to overlap every new childform.

    You've got the form's StartPosition property set to the WindowsDefaultLocation, which will show each for a little below and to the right of the previous. If you want the form displayed in a specific position then you need to set that property to Manual and set the Location property.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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