windowsforms-devexpress-dot-xtraspreadsheet-dot-customdrawcommentindicatoreventargs-232d71ca.md
Returns the cell’s boundaries, excluding cell borders.
Namespace : DevExpress.XtraSpreadsheet
Assembly : DevExpress.XtraSpreadsheet.v25.2.dll
NuGet Package : DevExpress.Win.Spreadsheet
public Rectangle CellBounds { get; }
Public ReadOnly Property CellBounds As Rectangle
| Type | Description |
|---|---|
| Rectangle |
A rectangle that specifies the cell’s size and location.
|
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.
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;
};
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