Table of Contents

Class ExButtonRenderer

Namespace
ExControls
Assembly
ExControls.dll

This class contains static methods to measure and draw buttons and text into the control graphics. This class cannot be inherited.

public static class ExButtonRenderer
Inheritance
ExButtonRenderer
Inherited Members

Methods

DrawCalendarButton(Graphics, Rectangle, Color, Color, Color, float)

Draws the drop-down button of a date picker: a small calendar glyph followed by a down arrow (the same shape as the DATEPICKER visual style glyph), all in glyphColor.

public static void DrawCalendarButton(Graphics g, Rectangle rec, Color backColor, Color borderColor, Color glyphColor, float scale = 1)

Parameters

g Graphics

Graphics to draw on.

rec Rectangle

Bounds of the button.

backColor Color

Background color of the button.

borderColor Color

Border color of the button.

glyphColor Color

Color of the calendar glyph and arrow.

scale float

DPI scale (1 at 96 dpi).

DrawCheckMark(Graphics, Rectangle, Color)

Draws the check mark used by ExCheckBox into the box, scaled to the box size (the shape is designed for a 16 px box).

public static void DrawCheckMark(Graphics g, Rectangle box, Color color)

Parameters

g Graphics

Graphics to draw on.

box Rectangle

Bounds of the check box.

color Color

Color of the mark.

DrawDropDownButton(Graphics, Rectangle, Color, Color, Color)

Draws a Drop-down button at the specific relative position with custom colors.

public static void DrawDropDownButton(Graphics g, Rectangle rec, Color backColor, Color borderColor, Color arrowColor)

Parameters

g Graphics

Graphics, where button will be drawn.

rec Rectangle

Relative bounds of drop-down button.

backColor Color

Background color of the button.

borderColor Color

Border color of the button.

arrowColor Color

Color of the button's arrow.

DrawTriangle(Graphics, Color, Point, int, ArrowDirection)

Draws a pixel-exact filled triangle (row by row, no anti-aliasing) pointing in the given direction. center is the center of the triangle's bounding box, size its height (number of rows/columns from the base to the tip); the base is 2 * size - 1 pixels long.

public static void DrawTriangle(Graphics g, Color color, Point center, int size, ArrowDirection direction)

Parameters

g Graphics

Graphics to draw on.

color Color

Fill color.

center Point

Center of the triangle.

size int

Height of the triangle in pixels.

direction ArrowDirection

Direction the tip points to.

GetBoxAndTextRectangle(IDeviceContext, ICheckableExControl, int, int)

Measures and returns bounds of the Text and Box of the ExCheckBox or ExRadioButton.

public static BoxAndTextRectangle GetBoxAndTextRectangle(IDeviceContext g, ICheckableExControl c, int boxSize, int boxOffset)

Parameters

g IDeviceContext

Graphics of the control.

c ICheckableExControl

Control (ExCheckBox or ExRadioButton).

boxSize int

Size of box.

boxOffset int

Distance between box and text.

Returns

BoxAndTextRectangle

Bounds of the box and of the text in client coordinates of the control.