GetItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Gets a particular style from the collection.
Syntax
public ParagraphStyle GetItem(string styleName);Public Function GetItem(styleName As String) As ParagraphStyleParameters
| Parameter | Description |
|---|---|
| styleName | Specifies the name of the style. |
Return Value
The return value is null, if a style with the specified name is not contained in the collection. Otherwise it is an object of the type ParagraphStyle.
Examples
The following example works with paragraph styles in the current document by using ParagraphStyleCollection.GetItem.
ParagraphStyleCollection paragraphStyleCollection = textControl.ParagraphStyles;
paragraphStyleCollection.Add(new ParagraphStyle("ReportHeading"));
var result = paragraphStyleCollection.GetItem("CustomerName");
Console.WriteLine($"Get Item result: {result}");Dim paragraphStyleCollection As ParagraphStyleCollection = textControl.ParagraphStyles
paragraphStyleCollection.Add(New ParagraphStyle("ReportHeading"))
Dim result = paragraphStyleCollection.GetItem("CustomerName")
Console.WriteLine($"Get Item result: {result}")