RemoveByIndex

TabStopCollection.RemoveByIndex method

Supprime un taquet de tabulation à l’index spécifié de la collection.

public void RemoveByIndex(int index)
ParamètreTaperLa description
indexInt32Un index dans la collection des taquets de tabulation.

Exemples

Montre comment sélectionner un taquet de tabulation dans un document par son index et le supprimer.

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

// Supprimez le premier taquet de tabulation.
tabStops.RemoveByIndex(0);

Assert.AreEqual(1, tabStops.Count);

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

Voir également