windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-customdraweventargs-9a09c25d.md
Returns a value specifying limits for the drawing area.
Namespace : DevExpress.XtraGrid.Views.Base
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public virtual Rectangle Bounds { get; }
Public Overridable ReadOnly Property Bounds As Rectangle
| Type | Description |
|---|---|
| Rectangle |
A Rectangle specifying the drawing area.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the Bounds property.
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.
winforms-grid-print-custom-draw-content/CS/MyXtraGrid/Form1.cs#L36
e.Appearance.BackColor = Color.Yellow;
e.Appearance.FillRectangle(e.Cache, e.Bounds);
Rectangle rect = e.Bounds;
winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/CS/CarsGridWinApp15/Main.cs#L37
return;
e.Appearance.FillRectangle(e.Cache, e.Bounds);
e.Cache.Paint.DrawMultiColorString(e.Cache, e.Bounds, e.DisplayText, filterCellText, e.Appearance, Color.Black, Color.Gold, false, filterTextIndex);
winforms-grid-multiple-row-selection-web-style-checkboxes/CS/E1271/CheckMarkSelection.cs#L233
e.Painter.DrawObject(e.Info);
DrawCheckBox(e.Cache, e.Bounds, SelectedCount == _view.DataRowCount);
e.Handled = true;
winforms-grid-change-color-of-highlighted-search-results/CS/WindowsApplication3/Main.cs#L30
if (cellInfo != null && cellInfo.ViewInfo != null && cellInfo.ViewInfo.HasMatchedString) {
e.Appearance.FillRectangle(e.Cache, e.Bounds);
e.Cache.Paint.DrawMultiColorString(e.Cache, e.Bounds, e.DisplayText, cellInfo.ViewInfo.MatchedRanges,
{
e.Appearance.FillRectangle(e.Cache, e.Bounds);
e.Painter.DrawObject(e.Info);
winforms-grid-print-custom-draw-content/VB/MyXtraGrid/Form1.vb#L36
e.Appearance.BackColor = Color.Yellow
e.Appearance.FillRectangle(e.Cache, e.Bounds)
Dim rect As Rectangle = e.Bounds
winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/VB/CarsGridWinApp15/Main.vb#L28
If filterTextIndex = -1 Then Return
e.Appearance.FillRectangle(e.Cache, e.Bounds)
e.Cache.Paint.DrawMultiColorString(e.Cache, e.Bounds, e.DisplayText, filterCellText, e.Appearance, Color.Black, Color.Gold, False, filterTextIndex)
winforms-grid-multiple-row-selection-web-style-checkboxes/VB/E1271/CheckMarkSelection.vb#L273
e.Painter.DrawObject(e.Info)
DrawCheckBox(e.Cache, e.Bounds, SelectedCount = _view.DataRowCount)
e.Handled = True
winforms-grid-change-color-of-highlighted-search-results/VB/WindowsApplication3/Main.vb#L32
If cellInfo IsNot Nothing AndAlso cellInfo.ViewInfo IsNot Nothing AndAlso cellInfo.ViewInfo.HasMatchedString Then
e.Appearance.FillRectangle(e.Cache, e.Bounds)
e.Cache.Paint.DrawMultiColorString(e.Cache, e.Bounds, e.DisplayText, cellInfo.ViewInfo.MatchedRanges, e.Appearance, e.Appearance.GetStringFormat(), Color.Indigo, Color.LightSlateGray, True)
Private Sub DrawGroupRow(ByVal e As DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs)
e.Appearance.FillRectangle(e.Cache, e.Bounds)
e.Painter.DrawObject(e.Info)
See Also