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
Printable View
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
Set the startposition property of child to centerparent
I hope this helpVB Code:
'this code goes inside child form Me.StartPosition = FormStartPosition.CenterParent
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
look at this if it helps if not let me know then :
Is
Me.Left = Me.MdiParent.Width /2 - (Me.Width /2)
Me.Top = Me.MdiParent.Height /2 - (Me.Height / 2)
What your trying to do?