How to position the game window?

Hi,

(no native speaker, sorry) : I’m learning how to make a menu and i’m stuck with the resolution. I can put the resolution and fullscreen it, it work well. But if i put my screen resolution, and i fullscreen it and remove it, it look likes it does nothing, because the title bar is off screen. So i try to use this to make the bar appear :

public static class Utilitaire
{
public static void FullScreenOff()
{

    Game1._graphics.IsFullScreen = false;
    Game1._graphics.ApplyChanges();
    Window.Position = new Point(0, 0);
}

}

The big problem is that i can just use Window in my Game1 class, in the other class i can’t. I have a Compiler Error CS0103. I cannot use this Game1.Window.Position = new Point(0, 0); because Window is not static.

Someone has an idea how to solve this problem?

Just add a public static reference for it.

In Game1.cs add public static GameWindow _window; near where you have public static GraphicsDeviceManager _graphics;, then in the constructor method (where your _graphics var is set - i.e. _graphics = new GraphicsDeviceManager(this)) add _window = Window;

In your FullScreenOff() method you can then use it just like the _graphics var. i.e. Game1._window.Position = new Point(0, 0);