Aspose::Words::TabStopCollection::GetPositionByIndex method
TabStopCollection::GetPositionByIndex method
Gets the position (in points) of the tab stop at the specified index.
double Aspose::Words::TabStopCollection::GetPositionByIndex(int32_t index)
Parameter | Type | Description |
---|---|---|
index | int32_t | An index into the collection of tab stops. |
ReturnValue
The position of the tab stop.
Examples
Shows how to find a tab, stop by its index and verify its position.
auto doc = System::MakeObject<Aspose::Words::Document>();
System::SharedPtr<Aspose::Words::TabStopCollection> tabStops = doc->get_FirstSection()->get_Body()->get_Paragraphs()->idx_get(0)->get_ParagraphFormat()->get_TabStops();
tabStops->Add(Aspose::Words::ConvertUtil::MillimeterToPoint(30), Aspose::Words::TabAlignment::Left, Aspose::Words::TabLeader::Dashes);
tabStops->Add(Aspose::Words::ConvertUtil::MillimeterToPoint(60), Aspose::Words::TabAlignment::Left, Aspose::Words::TabLeader::Dashes);
// Verify the position of the second tab stop in the collection.
ASSERT_NEAR(Aspose::Words::ConvertUtil::MillimeterToPoint(60), tabStops->GetPositionByIndex(1), 0.1);
See Also
- Class TabStopCollection
- Namespace Aspose::Words
- Library Aspose.Words for C++