Sign in to follow this  

[.net] XNA window size

This topic is 3813 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

This topic is 3813 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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