Results 1 to 5 of 5

Thread: Child Form

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    Child Form

    I want to make it when a child form is moved it will push back to centerscreen on the parent form...

    Any suggestions?

    Anjari

    P.s. and yes I did try center to parent but that didnt work... center to screen did but that made it uneven...

    Thanks again

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Set the startposition property of child to centerparent
    VB Code:
    1. 'this code goes inside child form
    2. Me.StartPosition = FormStartPosition.CenterParent
    I hope this help

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    Sorry...

    Maybe I should have made myself a little bit clearer... What I want to do is place code into the "Move" event that will replace the form to the center of the parent if it is moved...

    Basically I just don't want the person to move the form ... Maybe I am going about it the wrong way...

    Any Tips?

    Code Below:



    Thanks,

    Anjari

    P.S. - The above code doesnt work either that appears to be "Startup" settings...

    Code:
    Protected Overrides Sub OnClosed(ByVal e As System.EventArgs)
    
            'Show Menu Items
            Dim MainForm As New frmMain()
            MainForm = Me.ParentForm
            MainForm.mnuCompanyCompanyInformation.Visible = True
            MainForm.mnuCompanySpacer1.Visible = True
    
        End Sub
     
        Protected Overrides Sub OnMove(ByVal e As System.EventArgs)
    
            'Restore to Center Screen if Moved
    
    
        End Sub
    
        Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
    
            'Close Form
            Me.Close()
    
        End Sub
    Last edited by Anjari; Jan 28th, 2003 at 11:02 AM.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    look at this if it helps if not let me know then :

  5. #5
    Junior Member
    Join Date
    Jan 2003
    Location
    Seattle, WA
    Posts
    17
    Is

    Me.Left = Me.MdiParent.Width /2 - (Me.Width /2)
    Me.Top = Me.MdiParent.Height /2 - (Me.Height / 2)

    What your trying to do?

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