Back to Devexpress

ShapeCollection.AddTextBox(Cell, Single, Single, String) Method

officefileapi-devexpress-dot-spreadsheet-dot-shapecollection-dot-addtextbox-x28-devexpress-dot-spreadsheet-dot-cell-system-dot-single-system-dot-single-system-dot-string-x29.md

latest3.3 KB
Original Source

ShapeCollection.AddTextBox(Cell, Single, Single, String) Method

Inserts a text box so that its top left corner is located at the specified cell.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
Shape AddTextBox(
    Cell topLeftCell,
    float width,
    float height,
    string text
)
vb
Function AddTextBox(
    topLeftCell As Cell,
    width As Single,
    height As Single,
    text As String
) As Shape

Parameters

NameTypeDescription
topLeftCellCell

A cell where the top left corner of the text box should be located.

| | width | Single |

The text box’s width. The ISpreadsheetComponent.Unit property determines the unit of measurement.

| | height | Single |

The text box’s height. The ISpreadsheetComponent.Unit property determines the unit of measurement.

| | text | String |

The text box’s content.

|

Returns

TypeDescription
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

ShapeCollection Interface

ShapeCollection Members

DevExpress.Spreadsheet Namespace