Reputation: 41
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?
Upvotes: 4
Views: 4433
Reputation: 101
In the constructor of your MonoGame game class:
set:
Window.IsBorderless = true;
As per: https://monogame.codeplex.com/discussions/432292
Upvotes: 10