Jump to content
  • Advertisement
Sign in to follow this  
Montynis

[.net] XNA window size

This topic is 4031 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!