Back to Devexpress

CustomDrawCommentIndicatorEventArgs.CellBounds Property

windowsforms-devexpress-dot-xtraspreadsheet-dot-customdrawcommentindicatoreventargs-232d71ca.md

latest2.3 KB
Original Source

CustomDrawCommentIndicatorEventArgs.CellBounds Property

Returns the cell’s boundaries, excluding cell borders.

Namespace : DevExpress.XtraSpreadsheet

Assembly : DevExpress.XtraSpreadsheet.v25.2.dll

NuGet Package : DevExpress.Win.Spreadsheet

Declaration

csharp
public Rectangle CellBounds { get; }
vb
Public ReadOnly Property CellBounds As Rectangle

Property Value

TypeDescription
Rectangle

A rectangle that specifies the cell’s size and location.

|

Remarks

For a merged cell, the CellBounds property returns the boundaries of the entire merged area.

The following example demonstrates how to use the CustomDrawCommentIndicator event to display a square comment indicator.

csharp
spreadsheetControl1.CustomDrawCommentIndicator += (s, e) => {
    int size = e.Size;
    e.Cache.FillRectangle(e.Cache.GetSolidBrush(Color.FromArgb(0x21, 0x73, 0x46)), e.CellBounds.Right - size, e.CellBounds.Top, size, size);
    e.Handled = true;
};
vb
AddHandler SpreadsheetControl1.CustomDrawCommentIndicator,
    Sub(s, e)
        Dim size As Integer = e.Size
        e.Cache.FillRectangle(e.Cache.GetSolidBrush(Color.FromArgb(&H21, &H73, &H46)), e.CellBounds.Right - size, e.CellBounds.Top, size, size)
        e.Handled = True
    End Sub

See Also

CustomDrawCommentIndicatorEventArgs Class

CustomDrawCommentIndicatorEventArgs Members

DevExpress.XtraSpreadsheet Namespace