Aspose::Cells::Drawing::TextBoxCollection class

TextBoxCollection class

Encapsulates a collection of TextBox objects.

class TextBoxCollection

Methods

MethodDescription
Add(int32_t upperLeftRow, int32_t upperLeftColumn, int32_t height, int32_t width)Adds a textbox to the collection.
Clear()Clear all text boxes.
Get(int32_t index)Gets the TextBox element at the specified index.
Get(const U16String& name)Gets the TextBox element by the name.
Get(const char16_t* name)Gets the TextBox element by the name.
GetCount()
IsNull() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const TextBoxCollection& src)operator=
RemoveAt(int32_t index)Remove a text box from the file.
TextBoxCollection(TextBoxCollection_Impl* impl)Constructs from an implementation object.
TextBoxCollection(const TextBoxCollection& src)Copy constructor.
~TextBoxCollection()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;
//get collection object
TextBoxCollection textBoxCollection = workbook.GetWorksheets().Get(0).GetTextBoxes();
//add a textbox
textBoxCollection.Add(1, 1, 50, 100);
for (int i = 0; i < textBoxCollection.GetCount(); ++i)
{
    TextBox tbox = textBoxCollection.Get(i);
    //do what you want
}
Aspose::Cells::Cleanup();

See Also