Skip to main content
Row

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

ShapeCollection.AddTextBox(CellRange, String) Method

Inserts a text box to fit in the specified range.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

Shape AddTextBox(
    CellRange targetRange,
    string text
)

#Parameters

Name Type Description
targetRange CellRange

A cell range to which the inserted text box should fit.

text String

The text box’s content.

#Returns

Type Description
Shape

The resulting text box.

#Remarks

The following properties help you determine whether the current Shape object is a text box:

Use the ShapeFormatBase.Fill and ShapeFormatBase.Outline properties to change the text box’s fill and outline settings. The Shape.ShapeText property provides access to the shape’s text options.

To delete a text box, use the ShapeCollection.RemoveAt or Shape.Delete method.

See Also