System.Windows.Forms.ButtonRenderer Class

Provides methods used to render a button control with or without visual styles. This class cannot be inherited.

See Also: ButtonRenderer Members


public sealed class ButtonRenderer


The System.Windows.Forms.ButtonRenderer class provides a set of static methods that can be used to render a button control. Rendering a control refers to drawing the user interface of a control. To draw a button, use one of the erload:System.Windows.Forms.ButtonRenderer.DrawButton methods. These methods provide a variety of options, such as drawing text or an image on the button.

If visual styles are enabled in the operating system and visual styles are applied to the current application, erload:System.Windows.Forms.ButtonRenderer.DrawButton will draw the button with the current visual style. Otherwise, erload:System.Windows.Forms.ButtonRenderer.DrawButton will draw the button with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system.

This class wraps the functionality of a System.Windows.Forms.VisualStyles.VisualStyleRenderer that is set to one of the elements exposed by the System.Windows.Forms.VisualStyles.VisualStyleElement.Button.PushButton class. For more information, see Rendering Controls with Visual Styles.


Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions:
Since: .NET 2.0