[SOLVED] Monogame with winforms


I’m planning on creating a map editor for a C# game I’m building. I’ve done this previously using XNA and XNA’s old GraphicsDeviceControl, GraphicsDeviceService and ServiceContainer. I want the ability to create a class and inherit from the GraphicsDeviceControl class and then drag that class onto the form from the toolbox just like this: Youtube video

I’ve installed OpenTK using NuGet and followed this tutorial but when I create a class and inherit GraphicsDeviceControl it doesn’t show up in the form design toolbox. Am I doing something wrong or isn’t this possible using monogame? If it’s possible, what should I do to get it working?

Thanks in advance!

I’ve now heard that this might be possible with SharpDX but I can’t find the details. Does anyone know how?

Thanks in advance!

I finally managed to get it working :smiley:
I added every class that exists in the project called MGWinFormsControls in this github repo to my project. I already had a monogame.framework as well as OpenTK and OpenTK.GlControl reference. Then I created a class and inherited from GraphicsDeviceControl. At first this didn’t work but after only writing one line of code in the draw function in my class it worked. I just wrote GraphicsDevice.Clear(Color.Black). Now the class shows up in the toolbox