title: How do I get the underlying Window in MonoGame?
body: <p>I'm converting <strong><a href="https://github.com/SteveDunn/Gleed2D" rel="noreferrer">Gleed2D</a></strong> from XNA to MonoGame.  </p>
  
  <p>Gleed2D is a <strong>Windows Form application</strong> that instantiates an <code>XnaGame</code>.  The <code>window</code> created by the <code>Game</code> is then hidden and the <code>DeviceWindowHandle</code> is set to that of a <code>Canvas</code> on the main form.</p>
  
  <p>I know that's a bit of a mouthful; the code speaks for itself: <a href="https://github.com/SteveDunn/Gleed2D/blob/master/src/Gleed2D.Ui/XnaGame.cs" rel="noreferrer">here it is in full</a>.<br>
  The relevant bits are in the constructor:</p>
  
  <pre><code>            _drawSurface = mainForm.GetHandleToCanvas();
              _graphics = new GraphicsDeviceManager( this )
              {
                  PreferredBackBufferWidth = 800,
                  PreferredBackBufferHeight = 600
              } ;
  
          _graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
  
          _winform = (Form)Form.FromHandle(Window.Handle);
  
          _winform.VisibleChanged += game1VisibleChanged;
          _winform.Size = new Size(10, 10);
  
          Mouse.WindowHandle = _drawSurface;
  
          Size pictureBoxSize = _mainForm.CanvasSize ;
  
          ResizeBackBuffer( pictureBoxSize.Width, pictureBoxSize.Height ) ;
  
                      ... some other stuff....
  
  
      void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
      {
          e.GraphicsDeviceInformation.PresentationParameters.DeviceWindowHandle = _drawSurface;
      }
  </code></pre>
  
  <p>My question is: In XNA, the <code>Window.Handle</code> can be cast to a <code>Form</code>.  In MonoGame, it's implemented as an <code>OpenTK.GameWindow</code>.  <strong>How can I get to the actual window so that I can hide and/or resize it?</strong>.  An alternative question would be: <strong>How can I create a MonoGame <code>Game</code> and tell it the render surface is that of another control?</strong></p>