The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Table.TableBackgroundColor Property

Gets or sets the color of an empty space between cells.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

Color TableBackgroundColor { get; set; }
Property TableBackgroundColor As Color
Color TableBackgroundColor { get; set; }
Property TableBackgroundColor As Color

Property Value

Type Description
Color

A Color that is the color of the background.

Property Value

Type Description
Color

A Color that is the color of the background.

Remarks

By default, there is no empty space between cells. To specify a distance between cells, use the Table.TableCellSpacing property. The TableBackgroundColor is applied to an area around the cells with the width equal to double the Table.TableCellSpacing property value.

To change the cell background, use the TableCell.BackgroundColor property.

Important

The semi-transparent alpha component (i.e. the Color's alpha parameter set to value less than 255) is reset to opaque (255) during export to Word-like formats.

Examples

    ' Create a table.
    Dim table As Table = document.Tables.Create(document.Range.Start, 3, 5, AutoFitBehaviorType.AutoFitToWindow)
    table.BeginUpdate()
    ' Provide the space between table cells.
    ' The distance between cells will be 4 mm.
    document.Unit = DevExpress.Office.DocumentUnit.Millimeter
    table.TableCellSpacing = 2
    ' Change the color of empty space between cells.
    table.TableBackgroundColor = Color.Violet
    'Change cell background color.
    table.ForEachCell(New TableCellProcessorDelegate(AddressOf TableHelper.ChangeCellColor))
    table.ForEachCell(New TableCellProcessorDelegate(AddressOf TableHelper.ChangeCellBorderColor))
    table.EndUpdate()
Private Class TableHelper
    Public Shared Sub ChangeCellColor(ByVal cell As TableCell, ByVal i As Integer, ByVal j As Integer)
        cell.BackgroundColor = System.Drawing.Color.Yellow
    End Sub

    Public Shared Sub ChangeCellBorderColor(ByVal cell As TableCell, ByVal i As Integer, ByVal j As Integer)
        cell.Borders.Bottom.LineColor = System.Drawing.Color.Red
        cell.Borders.Left.LineColor = System.Drawing.Color.Red
        cell.Borders.Right.LineColor = System.Drawing.Color.Red
        cell.Borders.Top.LineColor = System.Drawing.Color.Red
    End Sub
End Class
See Also