Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxSpreadSheetAlignHorizontalCenter Class

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

#Declaration

Delphi
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