Sign in to follow this  
Montynis

[.net] XNA window size

Recommended Posts

Hello, I am trying programically change the size of XNA window. I have tried this code:
Form frm = (Form)Form.FromHandle(this.Window.Handle);
frm.width = 600;
But this doesn't work. How to solve it? Thanks in advance.

Share this post


Link to post
Share on other sites
If you are using the Game class, as far as I'm aware it should just be a matter of changing the graphics.PreferredBackBufferWidth/Height and then calling graphics.ApplyChanges().

This should cause a reset of the graphics device, so be aware of that if you have any viewports or default pool resources that need cleaned up and recreated after you do it.

Regards,
ViLiO

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this