Can you use Windows Forms in XNA?

Started by
3 comments, last by MJP 15 years, 11 months ago
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
-Dan- Can't never could do anything | DansKingdom.com | Dynamic Particle System Framework for XNA
Advertisement
http://creators.xna.com/Education/Samples.aspx

Scroll to the bottom of the page and enjoy. :)
NetGore - Open source multiplayer RPG engine
Quote:Original post by Spodi
http://creators.xna.com/Education/Samples.aspx

Scroll to the bottom of the page and enjoy. :)

Excellent!! This looks like it's exactly what I want! Thanks again!
-Dan- Can't never could do anything | DansKingdom.com | Dynamic Particle System Framework for XNA
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. :)
NetGore - Open source multiplayer RPG engine
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.

This topic is closed to new replies.

Advertisement