TX Text Control .NET for Windows Forms

TableCellFormat Class

Class
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.

Description

An instance of the TableCellFormat class represents the formatting attributes of a table cell.

Syntax

public class TableCellFormat

Examples

The following example shows how to format a table cell.

TXTextControl.TableCellFormat myCellFormat = new TXTextControl.TableCellFormat();

myCellFormat.BackColor = System.Drawing.Color.LightBlue;
myCellFormat.BottomBorderWidth = 150;
myCellFormat.VerticalAlignment = TXTextControl.VerticalAlignment.Bottom;

myTable.Cells.GetItem(1, 1).CellFormat = myCellFormat;

The following example creates a small report table and works with its structure.

textControl.Tables.Add(3, 3, 10);
Table table = textControl.Tables.GetItem(10);
TableCellFormat tableCellFormat = table.Cells[1, 1].CellFormat;

Members

Constructors

ConstructorDescription
TableCellFormatNot described in the reference. public TableCellFormat();

Properties

PropertyDescription
BackColorGets or sets the table cell's background color.
BottomBorderColorGets or sets the color of the table cell's bottom border.
BottomBorderWidthGets or sets, in twips, the width of the table cell's bottom border.
BottomTextDistanceGets or sets, in twips, the distance between the table cell's bottom border and its text.
LeftBorderColorGets or sets the color of the table cell's left border.
LeftBorderWidthGets or sets, in twips, the width of the table cell's left border.
LeftTextDistanceGets or sets, in twips, the distance between the table cell's left border and its text.
NumberFormatGets or sets a number format for the table cell. It can be used to automatically format numbers in table cells. When a formula is defined the automatically calculated text can also be formatted with a number format. When a number format is not defined, the property's value is an empty string. The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats. See Formatting Text by using Number Formats for more information.
RightBorderColorGets or sets the color of the table cell's right border.
RightBorderWidthGets or sets, in twips, the width of the table cell's right border.
RightTextDistanceGets or sets, in twips, the distance between the table cell's right border and its text.
TextTypeGets or sets the text type of the table cell which determines whether the cell's text is interpreted as a number or as text When the type is Standard, the cell's text is interpreted as text and it is displayed as it is. When the type is Number, the cell's text is interpreted as a number. The period character (.) is defined as decimal separator, the comma character (,) is defined as thousands separator.
TopBorderColorGets or sets the color of the table cell's top border.
TopBorderWidthGets or sets, in twips, the width of the table cell's top border.
TopTextDistanceGets or sets, in twips, the distance between the table cell's top border and its text.
VerticalAlignmentGets or sets the vertical alignment of the text in the table cell.