Hello!
Maybe this link can help you:
http://www.ziggyware.com/readarticle.php?article_id=67Can you give me some hints about how to run the engine inside a windows form? I had been able to run the engine on a window and then have a separate WinForm running at the same time, but I would like to do something like your screenshot.
I saw that before, but it didn't help. Thanks anyway
Yes, of course. But I am having a problem. I can not use the keyboard to type anything inside any UserControl. Mouse input is working great, but whenever a try to type any text, it simple doesn't type anything. Perhaps someone else could help us with that.
Create your engine.
Then, add a UserControl into your project and design it the way you want it, with the controls you want. For example lets make a menu. Look at this example:

Now, inside our engine class, we have to create our UserControl Menu and initialize it. I am going to add a public backColor variable to change it by clicking on a menu.
public class Game1 : Microsoft.Xna.Framework.Game
{
public UserControlMenu myUCMenu;
public Color backColor = Color.Black;
//Then inside the Initialize funtion:
protected override void Initialize()
{
// TODO: Add your initialization logic here
myUCMenu = new UserControlMenu(this);
Control gameWindow = Control.FromHandle(this.Window.Handle);
myUCMenu.Parent = gameWindow;
myUCMenu.Dock = DockStyle.Top;
base.Initialize();
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(backColor);
//The rest of your code
}
//The rest of your code
}
Now, we have to add the class of our engine into the UserControl Menu. If your engine class is called Game1, then before the constructor of your UserControl Menu, add this:
public partial class UserControlMenu : UserControl
{
Game1 gameEngine;
//Now, inside the contructor pass the same class again and pass it into "gameEngine". Like this:
public UserControlMenu( Game1 game)
{
gameEngine = game;
InitializeComponent();
}
//Now if you want to change the color of the backColor of the engine by clicking on a menu:
private void showAllPanelsToolStripMenuItem_Click(object sender, EventArgs e)
{
gameEngine.backColor = Color.Orange;
//If you want to change the Height of the UserControl Menu:
gameEngine.myUCMenu.height = 100;
}
}
And that is it, You can add as many UserControls as you want.
Now we need to figure out the solution for that problem.