public class TextBoxCollection extends CollectionBase
TextBox objects.
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//get collection object
TextBoxCollection textBoxCollection = workbook.getWorksheets().get(0).getTextBoxes();
//add a textbox
textBoxCollection.add(1, 1, 50, 100);
for(TextBox tbox : (Iterable<TextBox>) textBoxCollection)
{
//do what you want
}
//do your business
| Modifier and Type | Method and Description |
|---|---|
int |
add(int upperLeftRow,
int upperLeftColumn,
int height,
int width)
Adds a textbox to the collection.
|
void |
clear()
Clear all text boxes.
|
TextBox |
get(int index)
Gets the
TextBox element at the specified index. |
TextBox |
get(java.lang.String name)
Gets the
TextBox element by the name. |
void |
removeAt(int index)
Remove a text box from the file.
|
public TextBox get(int index)
TextBox element at the specified index.
Example
int index = textBoxCollection.getCount() - 1;
TextBox txb = textBoxCollection.get(index);
get in class CollectionBaseindex - The zero based index of the element.public TextBox get(java.lang.String name)
TextBox element by the name.
Example
String txtboxName = "textbox 1";
TextBox txb2 = textBoxCollection.get(txtboxName);
if(txb2 != null)
{
//do what you want
}
name - The name of the text box.public int add(int upperLeftRow,
int upperLeftColumn,
int height,
int width)
Example
//add a TextBox
int index2 = textBoxCollection.add(1, 1, 50, 100);
upperLeftRow - Upper left row index.upperLeftColumn - Upper left column index.height - Height of textbox, in unit of pixel.width - Width of textbox, in unit of pixel.TextBox object index.public void removeAt(int index)
Example
int index3 = textBoxCollection.getCount() - 1;
textBoxCollection.removeAt(index3);
removeAt in class CollectionBaseindex - The text box index.public void clear()
Example
//clear all textbox
textBoxCollection.clear();
clear in class CollectionBaseSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.