windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-customdraweventargs.md
Gets the painted element’s appearance settings.
Namespace : DevExpress.XtraGrid.Views.Base
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public virtual AppearanceObject Appearance { get; }
Public Overridable ReadOnly Property Appearance As AppearanceObject
| Type | Description |
|---|---|
| AppearanceObject |
A AppearanceObject object specifying the painted element’s appearance settings.
|
Each element within a View is painted using specific appearance settings (background and foreground colors, gradient mode, font, text alignment, etc). Appearance settings in the Grid Control are represented by AppearanceObject objects.
The Appearance property can be used in a number of ways:
The following code snippets (auto-collected from DevExpress Examples) contain references to the Appearance 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-highlight-cell-values-matching-text-in-autofilterrow/CS/CarsGridWinApp15/Main.cs#L38
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);
e.Handled = true;
winforms-grid-show-editor-buttons-on-cell-hover/CS/WindowsApplication3/Form1.cs#L44
textRect.Offset(e.Bounds.X, e.Bounds.Y);
EditorButtonObjectInfoArgs args = new EditorButtonObjectInfoArgs(e.Cache, info.Item.Buttons[0], e.Appearance);
Rectangle minBounds = info.EditorButtonPainter.CalcObjectMinBounds(args);
winforms-grid-draw-thick-border-abound-focused-cell/CS/Form1.cs#L132
e.Appearance.FillRectangle(e.Cache, e.Bounds);
((IViewController)view.GridControl).EditorHelper.DrawCellEdit(new GridViewDrawArgs(e.Cache, (view.GetViewInfo() as GridViewInfo), e.Bounds), (e.Cell as GridCellInfo).Editor, (e.Cell as GridCellInfo).ViewInfo, e.Appearance, (e.Cell as GridCellInfo).CellValueRect.Location);
}
winforms-grid-change-color-of-highlighted-search-results/CS/WindowsApplication3/Main.cs#L32
e.Cache.Paint.DrawMultiColorString(e.Cache, e.Bounds, e.DisplayText, cellInfo.ViewInfo.MatchedRanges,
e.Appearance, e.Appearance.GetStringFormat(), Color.Indigo, Color.LightSlateGray, true);
e.Handled = true;
winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/VB/CarsGridWinApp15/Main.vb#L29
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)
e.Handled = True
winforms-grid-show-editor-buttons-on-cell-hover/VB/WindowsApplication3/Form1.vb#L47
textRect.Offset(e.Bounds.X, e.Bounds.Y)
Dim args As New EditorButtonObjectInfoArgs(e.Cache, info.Item.Buttons(0), e.Appearance)
Dim minBounds As Rectangle = info.EditorButtonPainter.CalcObjectMinBounds(args)
winforms-grid-draw-thick-border-abound-focused-cell/VB/Form1.vb#L136
e.Appearance.FillRectangle(e.Cache, e.Bounds)
CType(view.GridControl, IViewController).EditorHelper.DrawCellEdit(New GridViewDrawArgs(e.Cache, (TryCast(view.GetViewInfo(), GridViewInfo)), e.Bounds), (TryCast(e.Cell, GridCellInfo)).Editor, (TryCast(e.Cell, GridCellInfo)).ViewInfo, e.Appearance, (TryCast(e.Cell, GridCellInfo)).CellValueRect.Location)
End Sub
winforms-grid-change-color-of-highlighted-search-results/VB/WindowsApplication3/Main.vb#L33
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)
e.Handled = True
See Also