BrickGraphics.DrawCheckBox(RectangleF, BorderSide, Color, Boolean) Method
Adds a specific CheckBoxBrick to a report.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v24.1.Core.dll
NuGet Package: DevExpress.Printing.Core
Declaration
public CheckBoxBrick DrawCheckBox(
RectangleF rect,
BorderSide sides,
Color backColor,
bool check
)
Parameters
Name | Type | Description |
---|---|---|
rect | RectangleF | The RectangleF structure that specifies the location and size of the current brick in measurement units, specified via the BrickGraphics.PageUnit property value. |
sides | BorderSide | Border settings for a specific CheckBoxBrick. |
backColor | Color | The color to fill the background of a specific CheckBoxBrick. |
check | Boolean | true, if the checkbox is in a checked state, otherwise, false. |
Returns
Type | Description |
---|---|
CheckBoxBrick | The CheckBoxBrick added to a report. |
Remarks
This method adds a specific CheckBoxBrick to a report. CheckBoxBrick position and size are specified via the rect parameter. After creation, the checkbox appears in the center of the created CheckBoxBrick. If this brick size is larger than the size of the checkbox, then the entire brick area, except the checkbox, will be filled with the color specified via the backColor parameter value. If the backColor parameter value is set to Color.Empty, the color fill for the brick area is defined via the BrickGraphics.BackColor property value. A user can create checkboxes in two states: checked and unchecked . The check parameter value defines the manner in which the checkbox is displayed. Graphical settings which are not defined via these method parameters are obtained from the corresponding BrickGraphics properties.
Example
This example demonstrates how to create a CheckBoxBrick using the BrickGraphics.DrawCheckBox method.
using DevExpress.XtraPrinting;
// ...
VisualBrick visBrick;
BrickGraphics brickGraph = printingSystem1.Graph;
// Start the report generation.
printingSystem1.Begin();
// Create a rectangle.
RectangleF rect = new RectangleF(new PointF(0, 0), new SizeF(60, 20));
// Specify a page area.
brickGraph.Modifier = BrickModifier.Detail;
// Add a checkbox brick to the report.
visBrick = brickGraph.DrawCheckBox(rect, BorderSide.All, SystemColors.ControlLight, true);
// Finish the report generation.
printingSystem1.End();
// Preview the report
printingSystem1.PreviewFormEx.Show();
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DrawCheckBox(RectangleF, BorderSide, Color, Boolean) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.