Karmel Cohen
Karmel Cohen

Reputation: 1

Is there a way to get Windows to ignore the manual WindowStartupLocation I'm using for a particular window?

I'm using WindowStartupLocation.Manual to open a window on my app and I wonder if there is a way to tell Windows to ignore that location and do not open the next window after this one (where it is not mentioned a specific location for it) following my window's location..

"Setting the WindowStartupLocation property to Manual causes a window to be positioned according to its Left and Top property values. If either the Left or Top properties aren't specified, their values are determined by Windows."

Upvotes: 0

Views: 155

Answers (1)

ShubhamWagh
ShubhamWagh

Reputation: 645

Although I could not reproduce the issue. A little research led me to this. There are other two factors that affect the positioning of the window.

  1. CenterOwner: The startup location of a Window is the center of the Window that owns it, as specified by the Owner property.
  2. CenterScreen: The startup location of a Window is the center of the screen that contains the mouse cursor.

So you can check the Owner property or check the mouse position when testing.

You can set the Owner window as follows:

Window1 p =new Window1();
p.Owner = this;

Upvotes: 0

Related Questions