Borderless fullscreen problem

I would’ve used normal fullscreen but I read that it is not yet supported for Monogame DirectX projects so I’m trying to get borderless.

When I add this code:

var screen = Screen.AllScreens.First(e => e.Primary);
Window.IsBorderless = true;
Window.Position = new Point(screen.Bounds.X, screen.Bounds.Y);
graphics.PreferredBackBufferWidth = screen.Bounds.Width;
graphics.PreferredBackBufferHeight = screen.Bounds.Height;

I get an error: The name ‘Screen’ does not exist in the current context.
I then add:

using System.Windows.Forms;

and a System.Windows.Forms reference to my project

And then I get 6 more errors:

Error	1	'System.Array' does not contain a definition for 'First' and no extension method 'First' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)	

Error	2	'ButtonState' is an ambiguous reference between 'System.Windows.Forms.ButtonState' and 'Microsoft.Xna.Framework.Input.ButtonState'	

Error	3	'System.Windows.Forms.ButtonState' does not contain a definition for 'Pressed'

Error	4	'Keys' is an ambiguous reference between 'System.Windows.Forms.Keys' and 'Microsoft.Xna.Framework.Input.Keys'	

Error	5	The best overloaded method match for
'Microsoft.Xna.Framework.Input.KeyboardState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys)' has some invalid arguments	

Error	6	Argument 1: cannot convert from 'System.Windows.Forms.Keys' to 'Microsoft.Xna.Framework.Input.Keys'

I am using VS Express 2013 for Windows Desktop, installed MonoGame 3.2 with an installer. Didn’t download XNA GS.
And I made a MonoGame Windows Project (DirectX).
How do I resolve this?

Hi!

When adding the using statement, the compiler doesn’t know which of the duplicate name classes you are refering to ( System.Windows.Forms.Keys or Microsoft.Xna.Framework.Input.Keys) , same for ButtonState, …)

Just using the “full path name” “System.Windows.Forms.Screen” instead of “Screen” and then adding the using statement should fix the problem.