Link Search Menu Expand Document

SSpread.TypeHAlign Property

Set the horizontal alignment within the cell.

Only valid for cells with the following CellType property.
$CellTypeDate (date type)
$CellTypeEdit (character type)
$CellTypePic (mask type)
$CellTypeStaticText (label type)
$CellTypeTime (time type)
$CellTypeComboBox (combo box type)
$CellTypePicture (picture type)
$CellTypeCheckBox (checkbox type)
$CellTypeCurrency (currency type)
$CellTypeNumber (numeric type)
$CellTypePercent (percent type)
$CellTypeScientific (exponential type)

Before setting this property, use the Col , Row properties, and so on to specify what to do.

Specify the following values.

Constant Value Explanation
$ TypeHAlignLeft 0 Left justified
$ TypeHAlignRight 1 Right justified
$ TypeHAlignCenter 2 Centered

The initial value depends on the data type of the cell.

Currency type, Numerical type, Percentage type, Exponential type $ TypeHAlignRight
Label type cells for column headers and row headers $ TypeHAlignCenter
Other than above $ TypeHAlignLeft

The vertical alignment is set with the TypeVAlign property.
The placement of command button cell types is set with the TypeButtonAlign property.

This property is subject to property inheritance for for each data type cell. Notes on property inheritance of combo box type cells
Notes on property inheritance of label type cells

Example of use

Col = 3;
Row = 2;
CellType = $ CellTypeStaticText;
TypeHAlign = $ TypeHAlignRight;
TypeVAlign = $ TypeVAlignBottom;
Text = "sample";
 
BlockMode = $ TRUE;
Col = 3;
Row = 3;
Col2 = 5;
Row2 = 5;
CellType = $ CellTypeNumber;
TypeHAlign = $ TypeHAlignLeft;
TypeVAlign = $ TypeVAlignCenter;
Value = 12345;
BlockMode = $ FALSE;

Related item
CellType , TypeButtonAlign ,TypeVAlign property