Jump to content
  • Advertisement
Sign in to follow this  
deadlydog

Can you use Windows Forms in XNA?

This topic is 3716 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

I am thinking of moving to using XNA and am wondering if it is possible to use the Windows Forms Controls in an XNA project. The reason I want to do this is simply that I don't want to have to build a user interface within my game/demo; I would like to use simple controls, such as checkboxes, combo boxes, etc which are already part of the Windows Forms. I was able to do this using managed DirectX simply by having DirectX draw to a panel, instead of the entire window. Is this possible in XNA? If it is not possible (or XNA does not have a similar feature) I will just stick with using managed DirectX and C# for now instead of switching to XNA just yet. Thanks

Share this post


Link to post
Share on other sites
Advertisement
No prob, Bob. When it comes to XNA stuff, I recommend always just at least skimming the sight real quick. There may not be a lot of content, but for what they do have, its of pretty great quality. :)

Share this post


Link to post
Share on other sites
Yeah that sample Spodi posted should get you started. What it does is really simple: instead of using the Xna.Framework.Game class (which is completely optional), it just creates a GraphicsDeviceService that creates a graphics device and implements IGraphicsDeviceService (so that the ContentManager class can locate the GraphicsDevice). Doing things without the Game class really isn't that hard, in fact I ditched the Game class for my actual game project so I could have the flexibility I wanted. It also allows me to more easily interface my common engine framework with both my map editor and my game.

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!