MDI Child Window Placement

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?
 
P

Peter Huang [MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top