GetPositionByIndex

TabStopCollection.GetPositionByIndex method

يحصل على موضع (بالنقاط) علامة التبويب عند الفهرس المحدد.

public double GetPositionByIndex(int index)
معامليكتبوصف
indexInt32فهرس لمجموعة علامات التبويب.

قيمة الإرجاع

موضع علامة التبويب.

أمثلة

يوضح كيفية العثور على علامة تبويب والتوقف عند فهرسها والتحقق من موقعها.

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(ConvertUtil.MillimeterToPoint(60), tabStops.GetPositionByIndex(1), 0.1d);

أنظر أيضا