The 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 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, DrawButton will draw the button with the current visual style. Otherwise, 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.

The following code example demonstrates how to create a custom control that uses the DrawButton method to draw a button. When the button is clicked, the control draws a smaller button inside the bounds of the original button, and the control uses the DrawParentBackground method to paint over the rest of the original button.