"CenterParent" not working

  • Thread starter Thread starter _dee
  • Start date Start date
D

_dee

Not a critical problem, just annoying:

Normally I use :
this.StartPosition = FormStartPosition.CenterParent;
in the constructor of a dialog to make sure it doesn't show up in the
corner of the screen somewhere. But sometimes it doesn't work. I
suspect that it interacts with another property.

I've also tried setting via the Property Page...same result: The
position seems to shift, just not to where you'd expect.

Anyone know about this?
 
When you Show() / ShowDialog(), etc - do you specify the parent via
the overload?

Marc
 
Not a critical problem, just annoying:

Normally I use :
this.StartPosition = FormStartPosition.CenterParent;
in the constructor of a dialog to make sure it doesn't show up in the
corner of the screen somewhere. But sometimes it doesn't work.

If you want the property to work consistently, then you need to
consistently set the parent. You can do this by passing a reference to
the parent to the ShowDialog() method.

If that doesn't work, then something odd is going on. You should post a
concise-but-complete sample of code that reliably reproduces the problem
in that case.

Pete
 
Back
Top