GetPositionByIndex

TabStopCollection.GetPositionByIndex method

Hämtar positionen (i punkter) för tabbstoppet vid det angivna indexet.

public double GetPositionByIndex(int index)
ParameterTypBeskrivning
indexInt32Ett index till samlingen av tabulaturer.

Returvärde

Tabstoppets position.

Exempel

Visar hur man hittar en flik, stannar till vid dess index och verifierar dess position.

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

// Verifiera positionen för det andra tabbstoppet i samlingen.
Assert.AreEqual(ConvertUtil.MillimeterToPoint(60), tabStops.GetPositionByIndex(1), 0.1d);

Se även