Skip to main content

TdxSpreadSheetShapeContainer Class

A simple shape floating container.

Declaration

TdxSpreadSheetShapeContainer = class(
    TdxSpreadSheetContainer
)

Remarks

Shape containers are different geometric shapes with transparency support that float over the worksheet table layer in the spreadsheet document. The current Spreadsheet control version allows you to create rectangles (or squares, depending on the container’s height-to-width ratio), rounded rectangles (or rounded squares) and ellipses (or circles):

The TdxSpreadSheetShapeContainer class is the ancestor of the TdxSpreadSheetPictureContainer, TdxSpreadSheetTextBoxContainer, and TdxSpreadSheetCommentContainer classes, providing the shape brush and outline-related functionality.

The TdxSpreadSheetShapeContainer class extends its ancestor with the Shape property, which allows you to specify shape-related container appearance settings.

TdxSpreadSheetShapeContainer 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 shape container object, you need to cast it to the TdxSpreadSheetPictureContainer type.

The following code example illustrates how to access the Shape property provided by the TdxSpreadSheetShapeContainer class and its descendants:

//...
var
  ATableView: TdxSpreadSheetTableView;
  AShapeContainer: TdxSpreadSheetShapeContainer;
//...
// Accessing the active Table View worksheet
  TableView := dxSpreadSheet1.ActiveSheetAsTable;
//
  if(ATableView.Containers[0] <> nil) and (ATableView.Containers[0].ClassName = 'TdxSpreadSheetShapeContainer') then
  begin
// Accessing the shape container variety of the first floating container object
    ShapeContainer := TdxSpreadSheetShapeContainer(TableView.Containers[0]);
    ShapeContainer.Shape.ShapeType := stRect;  // Specifying the rectangular shape of the container
  end;

Note

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

See Also