Class TextBoxCollection
Represents the collection of WTextBox in the Word document.
Inherited Members
Namespace: Syncfusion.DocIO.DLS
Assembly: Syncfusion.DocIO.Base.dll
Syntax
public class TextBoxCollection : CollectionImpl
Properties
Item[Int32]
Gets the WTextBox at the specified index from the TextBoxCollection.
Declaration
public WTextBox this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index to get the WTextBox. |
Property Value
Type | Description |
---|---|
WTextBox | The WTextBox at the specified index. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | The index is not valid in the TextBoxCollection. |
Methods
Clear()
Removes all the textboxes from the document.
Declaration
public void Clear()
Examples
private void Button1_Click(System.Object sender, System.EventArgs e)
{
//open a template document
WordDocument document = new WordDocument("Textbox.docx");
//Removes the textboxes from the document
document.TextBoxes.Clear();
//Save and close the document
document.Save("Sample.docx");
document.Close();
}
Private Sub button_Click(sender As Object, e As EventArgs)
'open a template document
Dim document As New WordDocument("Textbox.docx")
'Removes the textboxes from the document
document.TextBoxes.Clear()
'Save and close the document
document.Save("Sample.docx")
document.Close()
End Sub
RemoveAt(Int32)
Removes a WTextBox at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the WTextBox to remove. |
Examples
private void Button1_Click(System.Object sender, System.EventArgs e)
{
//open a template document
WordDocument document = new WordDocument("Textbox.docx");
//Remove the textbox at index one.
document.TextBoxes.RemoveAt(1);
//Save and close the document
document.Save("Sample.docx");
document.Close();
}
Private Sub button_Click(sender As Object, e As EventArgs)
'open a template document
Dim document As New WordDocument("Textbox.docx")
'Remove the textbox at index one.
document.TextBoxes.RemoveAt(1)
'Save and close the document
document.Save("Sample.docx")
document.Close()
End Sub