Skip to content

570D9EC7

Marcel Härtel edited this page Aug 19, 2023 · 1 revision

MonoGameControl Properties

Properties

AlwaysEnableKeyboardInput If enabled the Keyboard input will work even if the current control has no focus (mouse cursor is outside of the control).
(Inherited from GraphicsDeviceControl)
BackColor Set the background color of this Control in the designer.
(Inherited from GraphicsDeviceControl)
Components Get the GameComponentCollection.
(Inherited from GraphicsDeviceControl)
Editor The MonoGameService of the MonoGameControl draws and updates the actual content of the update control.
ForeColor Set the foreground color of this Control in the designer.
(Inherited from GraphicsDeviceControl)
GraphicsProfile Set the GraphicsProfile in the property grid during Design-Time (HiDef or Reach). You shouldn't change this during runtime!
(Inherited from GraphicsDeviceControl)
IsMouseInsideControl Returns true when the mouse cursor is inside the control.
(Inherited from GraphicsDeviceControl)
MouseHoverUpdatesOnly Set this to 'true' to only update this control when the mouse cursor is inside (OnMouseHover).

Remarks

This technique is useful when you only need to update this control temporarily or always on demand. Setting this property to 'true' will cause that this control will only consume CPU power to update its contents, when the mouse cursor is inside it or when you call 'RunOneFrame();' manually.
(Inherited from GameControl)

Services Get the GameServiceContainer.
(Inherited from GraphicsDeviceControl)
SwapChainRenderTarget A swap chain used for rendering to a secondary GameWindow. Note: When working with different RenderTarget2D, you need to set the current render target back to the SwapChainRenderTarget as this is the real 'Back Buffer'. 'GraphicsDevice.SetRenderTarget(null)' will NOT work as you are doing usally in MonoGame. Instead use 'GraphicsDevice.SetRenderTarget(SwapChainRenderTarget)'. Otherwise you will see only a black control window.
(Inherited from GraphicsDeviceControl)

See Also

Reference

MonoGameControl Class
MonoGame.Forms.NET.Controls Namespace

Clone this wiki locally