RemoveByIndex

TabStopCollection.RemoveByIndex method

Rimuove una tabulazione all’indice specificato dalla raccolta.

public void RemoveByIndex(int index)
ParametroTipoDescrizione
indexInt32Un indice nella raccolta delle tabulazioni.

Esempi

Mostra come selezionare una tabulazione in un documento tramite il suo indice e rimuoverla.

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

// Rimuovere la prima tabulazione.
tabStops.RemoveByIndex(0);

Assert.AreEqual(1, tabStops.Count);

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

Guarda anche