RemoveByIndex
TabStopCollection.RemoveByIndex method
Removes a tab stop at the specified index from the collection.
public void RemoveByIndex(int index)
Parameter | Type | Description |
---|---|---|
index | Int32 | An index into the collection of tab stops. |
Examples
Shows how to select a tab stop in a document by its index and remove it.
Document doc = new Document();
TabStopCollection tabStops = doc.FirstSection.Body.Paragraphs[0].ParagraphFormat.TabStops;
tabStops.Add(ConvertUtil.MillimeterToPoint(30), TabAlignment.Left, TabLeader.Dashes);
tabStops.Add(ConvertUtil.MillimeterToPoint(60), TabAlignment.Left, TabLeader.Dashes);
Assert.AreEqual(2, tabStops.Count);
// Remove the first tab stop.
tabStops.RemoveByIndex(0);
Assert.AreEqual(1, tabStops.Count);
doc.Save(ArtifactsDir + "TabStopCollection.RemoveByIndex.docx");
See Also
- class TabStopCollection
- namespace Aspose.Words
- assembly Aspose.Words