Skip to main content

TdxSpreadSheetAlignHorizontalCenter Class

An action object that implements the AlignHorizontalCenter end-user command in Spreadsheet and Report Designer-based applications.

Declaration

TdxSpreadSheetAlignHorizontalCenter = class(
    TdxSpreadSheetCustomAlignHorizontalAction
)

Remarks

This class does not introduce any new public members. Its overridden Execute function call centers the content horizontally in all cells selected in the active worksheet. As a result, the Style.AlignHorz property of all affected cell objects is set to ssahCenter.

If the content is already centered horizontally in all selected cells, the AlignHorizontalCenter command restores the horizontal alignment of the cells according to their content type (that is, centers logical values and aligns numeric values to the right border).

UI elements linked to a TdxSpreadSheetAlignHorizontalCenter action object are enabled only if the following conditions are met:

Note

To center the content between the top and bottom borders of all selected cells, use the AlignVerticalCenter command implemented as a TdxSpreadSheetAlignVerticalCenter action object.

See Also