3

Possible Duplicate:
Embed XNA in WinForms

HEY, please this is NOT DUPLICATE of that post. Its because you cant get any answer from it because its links are not working... and someone comments me that he got new link and when i saw that site it wasnt that i need...

I am making game that needs to login, and i want to make login in WinForm... but when i run winform and then after successfull login it should run game. I saw this Post on StackOverflow but the link for answer is ... abanonded ...

Community
  • 1
  • 1
GemHunter1
  • 441
  • 1
  • 4
  • 15

1 Answers1

5

XNA is bootstrapped in the Program.cs. Just add code in your winforms when the client is authenticated that starts the XNA game like in the Program.cs.

See http://www.codeproject.com/Questions/303672/XNA-And-Windows-forms

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        button1.Text = "Start!";
    }

    private void button1_Click(object sender, EventArgs e)
    {
        Thread theThread = new Thread(StartGame);
        theThread.Start();
    }
    public void StartGame()
    {
        Game1 game = new Game1();
        game.Run();
    }
}
Dustin Kingen
  • 20,677
  • 7
  • 52
  • 92