Question

I'm trying to port a XNA game to MonoGame. I only want to target Windows platform. I want to display the game in a borderless window. I do that, this way, in my XNA game:

private void SetForm()
    {
        Form myForm = (Form)Form.FromHandle(this.Window.Handle);
        myForm.Name = "WIPForm";            
        int width = 1024;
        int height = 768;           
        IntPtr auxptr = (this.Window.Handle);
        SafeNativeMethods.MoveWindow(
            (int)auxptr,
            0,
            0,
            Properties.Settings.Default.width,
            Properties.Settings.Default.height,
            1);
        myForm.FormBorderStyle = FormBorderStyle.None;
        myForm.SetBounds(0, 0, width, height);
    }

When I test this code in the monogame version myForm = null. Is there any way to draw a borderless window in the monogame version?

No correct solution

OTHER TIPS

In the constructor of your MonoGame game class:

set:

Window.IsBorderless = true;

As per: https://monogame.codeplex.com/discussions/432292

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top