MDI Child Window Placement

  • Thread starter Thread starter Mitchell Vincent
  • Start date Start date
M

Mitchell Vincent

Strange thing is happening.. I have the StartPosition of my MDI child
window set to CenterParent (at design time), yet when I close the window
and re-open it the start position gets shifted down and to the right
every single time, more and more.

This window will only ever be open once, but could be closed and
re-opened quite a bit - I'd like for the start position to stay the same
every time. Why would it be moving?
 
Hi

I have reported the problem, so far as a workaround I think you may try to
calculate the position manually.
e.g.

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem1.Click
Dim fm As New Form2
fm.MdiParent = Me
fm.StartPosition = FormStartPosition.Manual
fm.Location = New Point(Me.Left + (Me.Width - fm.Width) / 2, Me.Top
+ (Me.Height - fm.Width) / 2)
fm.Show()
End Sub

Hope this helps.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top