Back to Devexpress

CustomDrawDayNumberCellEventArgs.BackgroundElementInfo Property

windowsforms-devexpress-dot-xtraeditors-dot-calendar-dot-customdrawdaynumbercelleventargs-36d218aa.md

latest2.5 KB
Original Source

CustomDrawDayNumberCellEventArgs.BackgroundElementInfo Property

Gets or sets the skin element that is used to paint the background of the currently processed cell.

Namespace : DevExpress.XtraEditors.Calendar

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public SkinElementInfo BackgroundElementInfo { get; set; }
vb
Public Property BackgroundElementInfo As SkinElementInfo

Property Value

TypeDescription
DevExpress.Skins.SkinElementInfo

A SkinElementInfo object that specifies the skin element that is used to paint the background of the currently processed cell.

|

Example

The following example shows how to paint the background of numbers in a DateEdit control using the Editors.EditorButton skin element. The background is changed via the CustomDrawDayNumberCellEventArgs.BackgroundElementInfo property.

The result is shown below:

csharp
using DevExpress.Skins;

private void dateEdit1_DrawItem(object sender, DevExpress.XtraEditors.Calendar.CustomDrawDayNumberCellEventArgs e) {
    dE = sender as DateEdit;
    e.BackgroundElementInfo.Element = 
        EditorsSkins.GetSkin(dE.LookAndFeel.ActiveLookAndFeel)[EditorsSkins.SkinEditorButton];
}
vb
Imports DevExpress.Skins

Private Sub DateEdit1_DrawItem(ByVal sender As Object, _
  ByVal e As DevExpress.XtraEditors.Calendar.CustomDrawDayNumberCellEventArgs) _
  Handles DateEdit1.DrawItem
    dE = TryCast(sender, DateEdit)
    e.BackgroundElementInfo.Element = EditorsSkins.GetSkin(dE.LookAndFeel.ActiveLookAndFeel)(EditorsSkins.SkinEditorButton)
End Sub

See Also

CustomDrawDayNumberCellEventArgs Class

CustomDrawDayNumberCellEventArgs Members

DevExpress.XtraEditors.Calendar Namespace