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
gGraphicsGraphics to draw on.
recRectangleBounds of the button.
backColorColorBackground color of the button.
borderColorColorBorder color of the button.
glyphColorColorColor of the calendar glyph and arrow.
scalefloatDPI 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
gGraphicsGraphics to draw on.
boxRectangleBounds of the check box.
colorColorColor 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
gGraphicsGraphics, where button will be drawn.
recRectangleRelative bounds of drop-down button.
backColorColorBackground color of the button.
borderColorColorBorder color of the button.
arrowColorColorColor 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
gGraphicsGraphics to draw on.
colorColorFill color.
centerPointCenter of the triangle.
sizeintHeight of the triangle in pixels.
directionArrowDirectionDirection 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
gIDeviceContextGraphics of the control.
cICheckableExControlControl (ExCheckBox or ExRadioButton).
boxSizeintSize of box.
boxOffsetintDistance between box and text.
Returns
- BoxAndTextRectangle
Bounds of the box and of the text in client coordinates of the control.