Back to Devexpress

TileCustomDrawEventArgs.ShouldDrawDisabledOverlay Property

windowsforms-devexpress-dot-xtraeditors-dot-tilecustomdraweventargs-b74085e3.md

latest3.3 KB
Original Source

TileCustomDrawEventArgs.ShouldDrawDisabledOverlay Property

Gets whether the tile should display a disabled overlay.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual bool ShouldDrawDisabledOverlay { get; }
vb
Public Overridable ReadOnly Property ShouldDrawDisabledOverlay As Boolean

Property Value

TypeDescription
Boolean

true if the tile should display a disabled overlay; otherwise, false.

|

Remarks

When the ShouldDrawDisabledOverlay property returns true, you can draw your custom overlay for the disabled state or use the e.DrawDisabledOverlay method to draw the default overlay.

The following code snippet demonstrates the default drawing algorithm:

csharp
void tileView1_CustomDrawTile(object sender, TileViewItemCustomDrawEventArgs e) {
    switch (e.DrawingProcess) {
        case TileViewItemCustomDrawProcess.DrawTile:
            if (e.ShouldDrawBackground)
                e.DrawBackground();
            if (e.ShouldDrawContent)
                e.DrawContent();
            if (e.ShouldDrawHoveredOverlay)
                e.DrawHoveredOverlay();
            if (e.ShouldDrawDisabledOverlay)
                e.DrawDisabledOverlay();
            if (e.ShouldDrawBorder)
                e.DrawBorder();
            if (e.ShouldDrawCheckMark)
                e.DrawCheckMark();
            break;
        case TileViewItemCustomDrawProcess.DrawCheckMark:
            e.DefaultDraw();
            break;
        case TileViewItemCustomDrawProcess.DrawSelection:
            e.DefaultDraw();
            break;
    }
    e.Handled = true;
}
vb
Private Sub tileView1_CustomDrawTile(ByVal sender As Object, ByVal e As TileViewItemCustomDrawEventArgs)
    Select Case e.DrawingProcess
        Case TileViewItemCustomDrawProcess.DrawTile
            If e.ShouldDrawBackground Then e.DrawBackground()
            If e.ShouldDrawContent Then e.DrawContent()
            If e.ShouldDrawHoveredOverlay Then e.DrawHoveredOverlay()
            If e.ShouldDrawDisabledOverlay Then e.DrawDisabledOverlay()
            If e.ShouldDrawBorder Then e.DrawBorder()
            If e.ShouldDrawCheckMark Then e.DrawCheckMark()
        Case TileViewItemCustomDrawProcess.DrawCheckMark
            e.DefaultDraw()
        Case TileViewItemCustomDrawProcess.DrawSelection
            e.DefaultDraw()
    End Select

    e.Handled = True
End Sub

See Also

TileCustomDrawEventArgs Class

TileCustomDrawEventArgs Members

DevExpress.XtraEditors Namespace