Class TextBoxCollection

Class TextBoxCollection

Namespace: Aspose.Cells.Drawing
Assembly: Aspose.Cells.dll (25.2.0)

Encapsulates a collection of Aspose.Cells.Drawing.TextBox objects.

public class TextBoxCollection : CollectionBase<textbox>, IList<textbox>, ICollection<textbox>, IEnumerable<textbox>, ICollection, IEnumerable

Inheritance

objectCollectionBase<textbox>TextBoxCollection

Implements

IList<textbox>, ICollection<textbox>, IEnumerable<textbox>, ICollection, IEnumerable

Inherited Members

CollectionBase<textbox>.BinarySearch(TextBox), CollectionBase<textbox>.BinarySearch(TextBox, IComparer<textbox>), CollectionBase<textbox>.BinarySearch(int, int, TextBox, IComparer<textbox>), CollectionBase<textbox>.Contains(TextBox), CollectionBase<textbox>.CopyTo(TextBox[]), CollectionBase<textbox>.CopyTo(TextBox[], int), CollectionBase<textbox>.CopyTo(int, TextBox[], int, int), CollectionBase<textbox>.Exists(Predicate<textbox>), CollectionBase<textbox>.Find(Predicate<textbox>), CollectionBase<textbox>.FindAll(Predicate<textbox>), CollectionBase<textbox>.FindIndex(Predicate<textbox>), CollectionBase<textbox>.FindIndex(int, Predicate<textbox>), CollectionBase<textbox>.FindIndex(int, int, Predicate<textbox>), CollectionBase<textbox>.FindLast(Predicate<textbox>), CollectionBase<textbox>.FindLastIndex(Predicate<textbox>), CollectionBase<textbox>.FindLastIndex(int, Predicate<textbox>), CollectionBase<textbox>.FindLastIndex(int, int, Predicate<textbox>), CollectionBase<textbox>.IndexOf(TextBox), CollectionBase<textbox>.IndexOf(TextBox, int), CollectionBase<textbox>.IndexOf(TextBox, int, int), CollectionBase<textbox>.LastIndexOf(TextBox), CollectionBase<textbox>.LastIndexOf(TextBox, int), CollectionBase<textbox>.LastIndexOf(TextBox, int, int), CollectionBase<textbox>.GetEnumerator(), CollectionBase<textbox>.Clear(), CollectionBase<textbox>.RemoveAt(int), CollectionBase<textbox>.OnClearComplete(), CollectionBase<textbox>.OnClear(), CollectionBase<textbox>.Capacity, CollectionBase<textbox>.Count, CollectionBase<textbox>.InnerList, CollectionBase<textbox>.this[int], object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

csharp
[C#]
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//get collection object
TextBoxCollection textBoxCollection = workbook.Worksheets[0].TextBoxes;
//add a textbox
textBoxCollection.Add(1, 1, 50, 100);
foreach(TextBox tbox in textBoxCollection)
{
    //do what you want
}

//do your business

Properties

this[int]

Gets the Aspose.Cells.Drawing.TextBox element at the specified index.

public TextBox this[int index] { get; }

Property Value

TextBox

Examples

csharp
[C#]
int index = textBoxCollection.Count - 1;
TextBox txb = textBoxCollection[index];

this[string]

Gets the Aspose.Cells.Drawing.TextBox element by the name.

public TextBox this[string name] { get; }

Property Value

TextBox

Examples

csharp
[C#]
string txtboxName = "textbox 1"; 
TextBox txb2 = textBoxCollection[txtboxName];
if(txb2 != null)
{
    //do what you want
}

Methods

Add(int, int, int, int)

Adds a textbox to the collection.

public int Add(int upperLeftRow, int upperLeftColumn, int height, int width)

Parameters

upperLeftRow int

Upper left row index.

upperLeftColumn int

Upper left column index.

height int

Height of textbox, in unit of pixel.

width int

Width of textbox, in unit of pixel.

Returns

int

Aspose.Cells.Drawing.TextBox object index.

Examples

csharp
[C#]
//add a TextBox
int index2 = textBoxCollection.Add(1, 1, 50, 100);

Clear()

Clear all text boxes.

public void Clear()

Examples

csharp
[C#]
//clear all textbox
textBoxCollection.Clear();

RemoveAt(int)

Remove a text box from the file.

public void RemoveAt(int index)

Parameters

index int

The text box index.

Examples

csharp
[C#]
int index3 = textBoxCollection.Count - 1;
textBoxCollection.RemoveAt(index3);

</textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox></textbox>