Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualLordRhys

Posted 03 June 2013 - 07:44 AM

In order to do what you want you will have to use a WinForm project and drop in two files that will allow you to use the XNA graphics. You need to get GraphicsDeviceService.cs, and GraphicsDeviceControl.cs, you can find these in an example project on AppHub. Then when you drop your mapdisplay in the WinForm you do something like the following:


class MapDisplay : WinFormsGraphicsDevice.GraphicsDeviceControl
{
public event EventHandler OnInitialize;
public event EventHandler OnDraw;

protected override void Initialize()
{
if (OnInitialize != null)
OnInitialize(this, null);
}

protected override void Draw()
{
if (OnDraw != null)
OnDraw(this, null);
}
}

#1LordRhys

Posted 03 June 2013 - 07:43 AM

In order to do what you want you will have to use a WinForm project and drop in two files that will allow you to use the XNA graphics. You need to get GraphicsDeviceService.cs, and GraphicsDeviceControl.cs, you can find these in an example project on AppHub. Then when you drop your mapdisplay in the WinForm you do something like the following: class MapDisplay : WinFormsGraphicsDevice.GraphicsDeviceControl { public event EventHandler OnInitialize; public event EventHandler OnDraw; protected override void Initialize() { if (OnInitialize != null) OnInitialize(this, null); } protected override void Draw() { if (OnDraw != null) OnDraw(this, null); } }

PARTNERS