RemoveByIndex

TabStopCollection.RemoveByIndex method

Tar bort ett tabbstopp vid det angivna indexet från samlingen.

public void RemoveByIndex(int index)
ParameterTypBeskrivning
indexInt32Ett index till samlingen av tabulaturer.

Exempel

Visar hur man markerar och tar bort ett tabbstopp i ett dokument med hjälp av dess index.

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);

// Ta bort den första tabbstoppen.
tabStops.RemoveByIndex(0);

Assert.AreEqual(1, tabStops.Count);

doc.Save(ArtifactsDir + "TabStopCollection.RemoveByIndex.docx");

Se även