Skip to main content

TdxSpreadSheetTextBoxContainer Class

A floating text box container.

Declaration

TdxSpreadSheetTextBoxContainer = class(
    TdxSpreadSheetCustomTextBoxContainer
)

Remarks

A TdxSpreadSheetTextBoxContainer object is a floating shape container with the text box support. Unlike cell comments, text box containers support the same shape types that are available for both the shape and picture containers.

In addition to the settings common to all floating container types, the TdxSpreadSheetTextBoxContainer class provides the TextBox property that you can use to customize both the content and appearance of the displayed text box. For detailed information on basic floating container settings, refer to the TdxSpreadSheetShapeContainer class description.

TdxSpreadSheetTextBoxContainer objects are referenced by the worksheet‘s Containers collection as TdxSpreadSheetContainer objects, providing access only to the properties and methods that are common to all supported container types. To access the type-specific members of a text box container object, you need to cast it to the TdxSpreadSheetTextBoxContainer type.

The following code example illustrates how to access the TextBox property provided by the TdxSpreadSheetTextBoxContainer class:

//...
var
  ATableView: TdxSpreadSheetTableView;
  ATextBoxContainer: TdxSpreadSheetTextBoxContainer;
//...
// Accessing the active Table View worksheet
  ATableView := dxSpreadSheet1.ActiveSheetAsTable;
// Accessing the text box container variety of the first floating container object
  ATextBoxContainer := TdxSpreadSheetTextBoxContainer(ATableView.Containers.Items[0]);
  ATextBoxContainer.TextBox.AlignHorz := taCenter;  // Specifying the horizontal alignment for a text dispayed within the text box container

Note

In order to create a TdxSpreadSheetTextBoxContainer object, call the worksheet’s Containers.Add method. For additional information, refer to the Text Box-Specific Settings topic.

See Also