Sushisource

Hey everyone, I'm trying to figure out a quick and easy way to either hide the surrounding window of my XNA game entirely, or at least remove the buttons.

I could do this the long way, by making an actual windows form and a graphics device and blah blah blah... But I wanted to know if there is a quicker way to do this.


Thanks for any help.


Re: XNA Framework Hiding the minimize/maximize/close buttons

thedo

UNTESTED!!!!!!

Add a reference to system.windows.forms and then pop this code in

System.Windows.Forms.Form f = (System.Windows.Forms.Form)System.Windows.Forms.Form.FromHandle(this.Window.Handle);

The you *should* be able to adjust about anything you can with a form class. I cant stress enough I havent tested this yet, nor do I know if its even recommended. Obviously this will only work on Windows too........

 

EDIT

Just added it to my code and it compiles and runs fine. The returned value IS a window but I havent tried chaging any proprties of it yet.

EDIT 2

Removed the minimise box fine using

f.MinimizeBox = false;

so I know it works here, but again, I dont know if its a recommended way of doing things........






Re: XNA Framework Hiding the minimize/maximize/close buttons

redwyre

Why not just go into fullscreen mode I don't think removing those buttons is a good idea.



Re: XNA Framework Hiding the minimize/maximize/close buttons

Sushisource

I don't want to go full screen because the game is meant to be played in a very small screen, it's part of the gameplay.

But thanks thedo, that works perfectly.