Back to Devexpress

CustomDrawEventArgs.Bounds Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-customdraweventargs-9a09c25d.md

latest6.3 KB
Original Source

CustomDrawEventArgs.Bounds Property

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

Declaration

csharp
public virtual Rectangle Bounds { get; }
vb
Public Overridable ReadOnly Property Bounds As Rectangle

Property Value

TypeDescription
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

csharp
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

csharp
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

csharp
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

csharp
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,

winforms-grid-enable-editing-in-group-row-to-change-cell-values/CS/WindowsApplication3/GroupEditProvider.cs#L216

csharp
{
    e.Appearance.FillRectangle(e.Cache, e.Bounds);
    e.Painter.DrawObject(e.Info);

winforms-grid-print-custom-draw-content/VB/MyXtraGrid/Form1.vb#L36

vb
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

vb
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

vb
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

vb
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)

winforms-grid-enable-editing-in-group-row-to-change-cell-values/VB/WindowsApplication3/GroupEditProvider.vb#L204

vb
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

CustomDrawEventArgs Class

CustomDrawEventArgs Members

DevExpress.XtraGrid.Views.Base Namespace