XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

"Game" Class in MDI Form...

Last post 4/19/2009 8:43 AM by OrenYona. 4 replies.
  • 4/18/2009 6:28 PM

    "Game" Class in MDI Form...

    Hi,
    Is it possible to use the "game" class as an MDI child?

    I have a game engine and I'm working on making an editor.
    I want the editor to use the dll's from my game engine and render into a child form in an MDI interface....
    just to render into it, without having controls on it or anything.

    Any easy way to do it without messing around with the creator's club winForm example?

    How do I reach the properties of the form in order to set the MDI parent?

    Thanks in advanced,

    Oren
  • 4/18/2009 6:37 PM In reply to

    Re: "Game" Class in MDI Form...

    it's been a while since I looked at this, but can't you just cast the game's window/form to a "Form" object and set the requisite properties?
    Joel Martinez - XNA MVP
    Blog: http://codecube.net
    XNA Unit Testing: Scurvy Test
  • 4/18/2009 7:02 PM In reply to

    Re: "Game" Class in MDI Form...

    I tried that, but apperantly the game.Window does not derive from Form...
    I can't make that cast.
  • 4/18/2009 8:00 PM In reply to

    Re: "Game" Class in MDI Form...

    ok, I stopped being lazy and searched for what I was talking about.  Here's one example: http://www.codeproject.com/KB/cs/XnaFormHost.aspx?fid=443094&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2156543

    In that article, he talks about how you can get a control instance using the exposed Handle object: 

    System.Windows.Forms.Control xnaWindow =       System.Windows.Forms.Control.FromHandle((this.Window.Handle));

    Maybe you can give that a try
    Joel Martinez - XNA MVP
    Blog: http://codecube.net
    XNA Unit Testing: Scurvy Test
  • 4/19/2009 8:43 AM In reply to

    Re: "Game" Class in MDI Form...

    It didn't work...
    I got a control instance but I couldn't set its MDI parent nor add it to a form (because it's a top-level control).

    I also tried the example in the article (overriding "on preparing device") and it threw an exception...

    I tried dowloading this:

    http://www.nuclex.org/news/2007/05/14/xna-windows-forms-usercontrol

    But the example wouldn't work on VS2008.

    does anyone have this dll?

    EDIT:

    Nevermind that,
    I got it to work eventually as he suggested on his site.

    Thanks :-)
Page 1 of 1 (5 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG